Posts

Data Structure & Algorithm

Image
I am going to start the complete data structure and algorithm blog series to help the developer community understand the basics and help them become more productive in their work environment. As we all are under lockdown until the next update from the government, I have decided to support my friends and colleague to understand the data structure and algorithm. Let's begin by separating the data structure and algorithm in two terms. When you hear about data structure,  what comes first to your mind. I believe most of you thought of storing any form of data in an efficient way. Yes, You are correct 👍. Now, Second and the most important term is an algorithm , It is a set of rules to be followed to solve a problem. To gain more understanding of the data structure and algorithm, let us take an example:- E.g., We are all going to attend the google conference and they have a single registration desk. If we all reach the registration counter together, to register ourselves. Such a ...

Understanding of Asymptotic Notation

Whenever we solve any problem there is a sequence of steps that needs to be followed. We have already read the term algorithm, which is nothing but a sequence of steps to achieve the result. Our algorithm took some time and space to solve it. The running time depends upon several factors:- Single/Multiple processor system. R/W speed to memory. CPU speed. 32/64 bit system. Input Size. Do we really need all the factors to calculate the time complexity? Don't you think the hardware couldn't be a factor in the time calculation of the algorithm? Let's understand this in more detail. For example, Kavya and I are working on the problem that needs us to calculate the sum of n natural numbers. We come up with a different-2 approach to solve the problem. Now, Kavya has an i7 machine and running the code, it takes less than 1 ms and I have a dual-core machine that takes 5ms and there is a huge possibility that when I run the same code in a high configuration machine then i...