Stack in Data Structures

Abstract Data Types: It is a set of classes or types for objects such that their behavior is defined by a set of operations and values. The definition depicts that only operations can be performed but mention neither how these operations work at the ground level nor how the storage space is consumed. The stack […]

Enhanced Merge Sort

What is Merge Sort? Not remembering? We got you covered. Click here to revise Merge sort. Now, we shall look how we can improvise the conventional or traditional approach of Merge sort. Note: This particular article has been derived from a research paper. The reference to the paper is provided at the “Reference and Recommendations” […]

Quick Sort

Let me start with a question. Have you ever been to a school prayer or assembly? How do you stand there? Based on height. When you are asked to arrange among yourselves, students know that one is the tallest and the other is the smallest of all. They stand at both ends. The remaining would […]

Merge sort

“Together we stand, separated we fall!” Will modify this to “Divide and Conquer”. What we require here is, how to divide the given set of elements and merge (conquer) them in order, basically sort. How this division flows and merging done? Let’s get through it. Algorithm: Step 1: Divide the array into sub-arrays until a […]

Binary Search

Imaginary situation: “Assume there was a crime incident at some large building. There is a team of police officers who arrived at the crime scene. They are searching and collecting evidence from different parts of the building.” The question, in our context, is not what the crime is! The relation is how will they search? […]

Huffman’s Coding Algorithm

Have you ever thought of how your data on Internet is secured? When you send a photo on any platform, it will be compressed, encrypted and transmitted. The image should be transmitted without any loss in pixels or data. So, several algorithms play a major role in these operations. One such algorithm is Huffman coding […]

Dijkstra’s Algorithm

We have seen Prim’s Algorithm for Minimum Spanning Tree. Dijkstra’s Algorithm, also known as Single source Shortest Path, is similar to it but we use it for graphs. When we are provided with a graph and a source vertex, this method is used to find the minimum distance of that particular vertex from the source […]

Linear Search

Linear search or a sequential search is a method used to find an element in a list or an array. It searches for the element sequentially i.e. one after other until the required element is found. Algorithm: Input the no. of elements in which the number has to be searched. Now, read the list of elements. Input the element to search for. Using a loop, search for the element in the list of elements. Exit loop. Stop. Pseudo Code: Code in Java: Time Complexity: Best case: When the […]

Kruskal’s Algorithm

Kruskal’s Algorithm is almost similar to Prim’s Algorithm. The difference is that in Prim’s algorithm, the root node chosen is the one having minimum weight but in Kruskal’s algorithm the root vertex is chosen randomly provided the edges are arranged in the ascending order. Here are few steps to follow in finding Minimum Spanning Tree […]

Prim’s Algorithm

Prim’s algorithm is used to find the minimum spanning tree from a graph. It finds the subset of edges that includes every vertex such that the total of the weights of edges should be minimum. How this is done? Will go through the step-by-step procedure! Algorithm: Step 1: From the given graph, remove all loops […]

Greedy method

“Do you want to buy a car?” If this is the situation, how would you choose a car? Assume that you need a car with better features. Will you go on testing or checking all the car models in the world and then buy it? My answer would be no. I shall separate out or […]

What is Time Complexity?

Reading Time | 7-10 min In every course about algorithms, the subject of complexity of algorithms is introduced right at the beginning. This implies that the topic plays an important role in understanding algorithms, and I can assure you that it certainly does. Don’t believe me? Read on. The Need for Speed(complexity) Every algorithm in […]

What is an Algorithm?

On a cold, rainy day, nothing is more welcome than a warm, sweet cup of tea(or coffee, if you like). To make a cup of this delicious liquid, a sequence of steps is followed by the person who makes it. Similarly, to solve a problem using computers, an algorithm is used. Knowledge about the meaning […]