Category: Data Structures

  • Greedy Algorithm

    Greedy Algorithm is an approach for solving a problem by selecting the best option available at the moment. It doesn’t matter whether the current best result will bring the overall optimal result or not. The algorithm never reverses the earlier decision even if the choice is wrong. It works in a…

  • Binary Search Tree

    Binary Search Tree is a type of Binary Tree, where it follows some specific order in arranging the elements, In a binary search tree, the value of the left node should be less than the root node, the value of the right node should be greater than the root node.…

  • Dijsktra’s Algorithm:

    Dijkstra’s algorithm allows us to find the shortest path between any two vertices of a graph. How Dijkstra’s Algorithm works Dijkstra’s Algorithm works on the basis that any subpath B -> D of the shortest path A -> D between vertices A and D is also the shortest path between vertices B and D.…

  • Kruskal’s Algorithm:

    Kruskal’s algorithm is a minimum spanning tree algorithm that takes a graph as input and finds the subset of the edges of that graph which How Kruskal’s algorithm works Kruskal’s algorithm is a type of greedy algorithm that finds the local optimum in the hopes of finding a global optimum. We start…

  • Prims Algorithm:

    Prim’s algorithm is a minimum spanning tree algorithm that takes a graph as input and finds the subset of the edges of that graph which How Prim’s algorithm works It falls under a class of algorithms called Greedy Algorithm that find the local optimum in the hopes of finding a global optimum.…

  • Graph Traversal

    A graph is a non-linear data structure, which is represented by vertices(nodes) and edges. Every pair of vertices is connected with one edge between them. In simple words, traversal means the process of visiting every node in the graph. There are 2 standard methods of graph traversal Breadth-First Search and Depth First Search Breadth First Search Breadth-First Search (BFS) is…

  • Linked List

    Linked list is a linear data structure that includes a series of connected nodes. Here each node stores the data and the address of the next node. Code:

  • Queue Implementation using Linked List

    Queue is a linear data structure, which follows the First In First Out(FIFO) fashion. It is the collection of similar data types Queue contains two pointers namely, *front , *rear. Before Inserting element into the Queue front pointer and rear pointer will be pointing to NULL. While Enqueuing an element…

  • Stack Implementation using Linked List

    Stack is a linear data structure, which is collection of items of the same data type. Stack follows the Last-In-First-Out (LIFO) fashion, where the last element inserted first will be popped out first. Push and Pop only at one end Code:

  • Hashing

    Hashing is a technique which is used to search for an element in the less time complexity. Already we have Linear search and Binary search which uses the O(n) and O(log n) time complexity. To reduce the time complexity than any other data structure hashing concept is introduced which has…