Update appNew update is available. Click here to update.

Data Structure

Mohammed Afzal
Last Updated: Nov 24, 2022

What is Data Structure?

Data Structure is a well-thought way to store and access data in a way that makes sense and is efficient to retrieve the data and put it back in, simple! 

As I mentioned earlier too, we are surrounded by data. I don't doubt it, or do you?! Try to find the answer to that if you still are not sure.

When working with data, it needs to be stored somewhere for later use. You might use the data to understand the behaviour of the users or may just recommend products on the basis of their past shopping history. 

So, storing and managing data is the next big challenge! Here is where data structure comes into the picture. Before I give you my definition of data structure, let me give you something really concrete to make this concept of data structure clear.

We see a lot of things around our house, is not it? For instance, your clothes, footwear, and kitchen items like grains, spices, salt and sugar. You might wonder why am I mentioning all these things, I know it is weird but you see, all these items have structured storage space! And this is the point I am trying to make! Your clothes go into your wardrobe and not into the containers where the spices are stored.

Similarly, when we work with data in the digital world, it is essential to think of a structure where we can store or keep these data that make sense in terms of accessibility. Efficiency can come later.  

We have a variety of Data Structures which are as follows:

  1. Arrays
  2. Strings
  3. Linked List
  4. Stack
  5. Queue
  6. Heap and Priority Queue
  7. Hashmap
  8. Binary Tree
  9. Binary Search Tree
  10. AVL Tree
  11. Red Black Tree
  12. Trie
  13. Suffix Tree
  14. Graph
  15. Segment Tree
  16. Fenwick Tree
  17. Sparse Table
  18. Set


  1. Single Number
  2. Sliding Window
  3. Find the Number Occurring Odd Number of Times
  4. Next Permutation
  5. Searching and Sorting in Rotated Sorted Array
  6. Radix Sort
  7. Bucket Sort
  8. Counting Sort
  9. Heap Sort
  10. Smallest Index with Equal Value
  11. Aggressive Cows
  12. Book Allocation Problem
  13. Binary Search Vs Ternary Search
  14. Ternary Search
  15. Square Root using binary search
  16. Divide the Chocolate
  17. Find the minimum element in a sorted and Rotated Array
  18. Minimum coverage by heaters
  19. Plates Between Candles
  20. To Find the Nth Number in the Merged and Sorted Lists of Given Ranges
  21. Find the Maximum Sum of i*arr[i] Among all Possible Rotations of an Array
  22. Multiple left rotations of an array with O(1)
  23. Reversal algorithm for right rotation of an array
  24. Reversal Algorithm for Array Rotation
  25. Rotation Count
  26. Program for Array rotation in Java
  27. Sort a Rotated Sorted Array
  28. Sort a Rotated Sorted Array
  29. Moore’s Voting Algorithm
  30. Next Greater and Smaller Element for Every Element in an Array


  1. Count Valleys
  2. Compare Version Numbers
  3. Count and Say
  4. Longest word in dictionary
  5. Check If a String is a Palindrome
  6. Car Fleet
  7. String matching naive
  8. KMP String Matching Algorithm
  9. Rabin Karp

Linked List

  1. Why is Quick Sort preferred for Arrays and Merge Sort for Linked Lists?
  2. Application of Linked List Data Structure
  3. Linked List remove() Method in Java
  4. How to Convert all LinkedHashMap Values to a List in Java
  5. Difference between a singly linked list and a doubly linked list
  6. Create Linked List From A Given Array
  7. Binary search on Linked List
  8. Insert a node at a specific position in a linked list
  9. Deletion of a linked list
  10. Unrolled linked list
  11. Implementing a Linked List in Java Using Class
  12. LinkedList descendingIterator in Java
  13. Construct a Linked List from a 2D Matrix
  14. Advantages and Disadvantages of LinkedList
  15. LinkedList implementation in JavaScript
  16. Is it possible to reverse a linked list in less than O(n)?
  17. How to write the functions that modify the head pointer of a Linked List in C?
  18. Generic Linked List in C
  19. LinkedList listIterator() method in Java
  20. Java.util.LinkedList.offer(), offerFirst(), offerLast() in Java
  21. Retrieving Value from a LinkedHashMap by Index in Java
  22. LinkedList removeFirst method in Java
  23. LinkedList add() method in Java
  24. LinkedList addAll() method in Java
  25. Singly Linked List To Circular Linked List
  26. Check If A Linked List Is Circular Linked List
  27. Circular Linked List Traversal
  28. Convert a given Binary Tree to Doubly Linked List
  29. Reverse a Doubly-Linked List in Given Size
  30. Memory-efficient doubly linked list


  1. Stack in C++ (STL)
  2. Stack Class in Java Collection Framework
  3. Stack in Python (LIFO Queue)
  4. Python Stack Using Doubly Linked List
  5. Difference Between Stack and Tree
  6. Difference between Array, Queue and Stack
  7. Implement stack using a singly linked list
  8. Implement stack using a doubly-linked list
  9. Next greater/smaller element using a monotonic queue
  10. Iterative Tower of Hanoi
  11. Remove Adjacent Duplicates
  12. Design A Minimum Stack
  13. Trapping Rainwater
  14. Delete Middle Element Of The Stack
  15. Count array elements having at least one smaller element on its left and right side
  16. Minimize the length of a given string by removing subsequences forming valid parenthesis
  17. Add two numbers represented by Stacks
  18. Diagonal Traverse ii
  19. Minimize a binary string by repeatedly removing even-length substrings of the same characters
  20. Minimize A String By Removing All Occurrences Of Another String
  21. Maximum Equal Sum in Three Stacks
  22. Print Stack Elements from Top to Bottom
  23. Smallest String Obtained By Removing All Occurrences of 01 and 11 from the Binary String
  24. Count of days remaining for the next day with higher temperature
  25. Count of strings that do not contain Arc intersection
  26. Minimize Length of a String by Removing Pairs of Consecutive Increasing or Decreasing Digits
  27. Largest rectangle in histogram
  28. Reverse a linked list using Stack
  29. Count subarrays for every array element in which they are the minimum
  30. Check if a string is a subsequence of another string using stack


  1. Difference between Queue and Deque in C++
  2. Advantages of circular queue over linear queue
  3. Queue of Pairs in C++ STL
  4. Implementation Of Queue in Java using Array and Generics
  5. How to remove a specific element from queue
  6. Queue Remove Method in Java
  7. Dumping Queue Into List or Array in Python
  8. Find the index of the array elements after performing given operations k times
  9. Find Nth positive number whose absolute difference of adjacent digits is at most 1
  10. Circular queue implementation and operations
  11. Implement dynamic Deque using templates class and a circular array
  12. Design Front Middle Back Queue using STL
  13. Implementation of Deque Using Doubly Linked List
  14. Generate a permutation of first N natural numbers having count of unique adjacent differences equal to K
  15. Array obtained by repeatedly reversing array after every insertion from the given array
  16. First non-repeating character in a stream
  17. How to efficiently implement k Queues in a single array?
  18. Sorting of Queue
  19. Queue Reconstruction by Height

Heap and Priority Queue

  1. Applications of Heap - Data Structure
  2. Binary Heap
  3. Tournament Trees and Binary Heaps
  4. Implementation of Heap
  5. Binomial Heap
  6. Fibonacci Heap
  7. Leftist Heap
  8. N-ary Heap
  9. Priority Queue using Java
  10. Priority Queue Implementation using Linked List
  11. Priority Queue Using Doubly Linked List
  12. Priority Queue Using a Linked List
  13. Priority Queue using array in C++
  14. Priority Queue using C++
  15. Applications of Priority Queue
  16. Double Ended Priority Queue
  17. Priority Queue of Pairs In C++ with Ordering
  18. Converting a BST to Min Heap
  19. Kth smallest element in a row-wise and column-wise sorted 2D array
  20. N Max Pair Combinations
  21. Connect N Ropes
  22. Median of Stream of Integers Problem
  23. Connect N ropes with minimum cost
  24. Sum and product of K smallest and largest Fibonacci numbers in the array
  25. K-th Smallest Pair Sum in The Given Array
  26. Maximum product of an Array after subtracting 1 from any element N times
  27. Find the K closest points to origin using Priority Queue
  28. Length of longest subsequence such that prefix sum at every element remains greater than zero
  29. The maximum sum of two non-overlapping intervals in a list of Intervals | Interval Scheduling Problem
  30. Minimum difference between maximum and minimum value of Array with given Operations


  1. Implementation of HashMap
  2. Index Mapping
  3. Double hashing
  4. Load Factor and Rehashing
  5. Hash Table vs STL Map
  6. Difference between HashMap and Hash Table in Java
  7. Separate Chaining and Open Addressing for Collision Handling
  8. Binary Subarrays with sum
  9. LRU Cache Implementation
  10. Asteroid Collision
  11. Count Number of Subarrays with Sum K
  12. Reduce Array Size to The Half
  13. Minimum operations to choose Array elements with sum as K by choosing an element from the front, or rear or both
  14. Length Of All Prefixes That Are Also The Suffixes Of The Given String
  15. Online Election
  16. Find the highest frequency of non-negative powers that are the same as indices of elements in the given array
  17. Longest Substring Without Repeating Characters
  18. The K Weakest Rows in a Matrix
  19. Count the Triplets
  20. Kth Distinct String in an Array
  21. Stone Game VI
  22. Permutation in String
  23. Find All Duplicates in an Array
  24. Longest Consecutive Sequence
  25. N Repeated Elements in Size 2N
  26. Custom Sort String
  27. Winner of Tic-Tac-Toe

Binary Tree

  1. Binary Tree using dstructure library in Python
  2. Types of Binary trees
  3. Create a Balanced Binary Tree using leaf Nodes of a Binary Tree without using Extra Space
  4. N-Ary Trees
  5. Construct a Binary Tree from a given Preorder and Inorder traversal
  6. The Binary Lifting Technique
  7. Construct a Complete Binary Tree from its Linked List Representation
  8. Convert a generic tree (n-ary tree) to binary tree
  9. Double Order Traversal of a Binary Tree
  10. Specific Level Order Traversal of Binary Tree
  11. Iterative Postorder Traversal of Binary tree
  12. Iterative Postorder Traversal of a binary tree | Part-2
  13. Iterative Preorder Traversal of Binary tree
  14. Clockwise Triangular Traversal of a Binary Tree
  15. Level Order Traversal Of A Binary Tree
  16. ZigZag Traversal of Binary Tree
  17. Boundary Traversal Of Binary Tree (Recursive and Iterative)
  18. Iterative Inorder Traversal of Binary tree
  19. Morris Traversal for Inorder
  20. Print all Prime Levels of a Binary Tree
  21. Bottom-left to upward-right Traversal in a Binary Tree
  22. Check if given inorder and preorder traversals are valid for any Binary Tree without building the tree
  23. Construct A Perfect Binary Tree From A Preorder Traversal
  24. Inorder Successor in Binary Tree
  25. Right View of a Binary Tree
  26. Left View of a Binary Tree in Java
  27. Top view of a binary tree | Part-1
  28. Diameter of Binary Tree
  29. Convert a given Binary Tree to a Doubly Linked List
  30. Symmetric Binary Tree

Binary Search Tree

  1. Introduction to Binary Search tree
  2. Difference between binary tree and binary search tree
  3. Inbuilt Binary Search in Different Languages
  4. Binary Search Tree | Iterative Delete
  5. Implementing Backward Iterator in BST
  6. Implementing Forward Iterator in BST
  7. Insertion in Binary Search Tree
  8. Insert a node in Binary Search Tree Iteratively
  9. Construct BST from the given pre-order traversal
  10. Construct a BST from given postorder traversal using Stack
  11. Lowest Common Ancestor in a Binary Search Tree
  12. Finding inorder predecessor of a node in a Binary Search Tree
  13. Finding Inorder Successor of a node in a Binary Search Tree
  14. Number of Binary Search Trees of height H consisting of H+1 nodes
  15. Range Sum of BST
  16. Flatten a Binary Search Tree to Convert the Tree into a Wave List in Place Only
  17. Flattening BST in Sorted List
  18. Row with the maximum number of 1’s
  19. Create a wave array from the given Binary Search Tree
  20. Sum of all nodes with smaller values at a distance ‘K’ from the given node in BST
  21. Median of All Nodes from a Given Range in a BST
  22. Print All Odd Nodes Of Binary Search Tree
  23. Print all the even nodes of a Binary Search Tree
  24. Node with the maximum value in a Binary Search Tree
  25. Sum and the Product of minimum and maximum elements of a Binary Search Tree
  26. Find Closest Smaller Value For Every Element In Array
  27. Find Closest Value For Every Element In Array
  28. Find the median of BST in O(N) time and O(1) space.
  29. Kth Largest Element BST
  30. Largest BST subtree in the given Binary Tree

AVL Search Tree

  1. Self Balancing Binary Search Trees
  2. Introduction To AVL Trees
  3. How to Insert Strings into an AVL Tree
  4. Optimal Sequence for AVL Tree Insertion
  5. Deletion in AVL Tree
  6. Insertion, Searching, and Deletion in AVL trees containing a parent node pointer

Red Black Tree

  1. Introduction To Red-Black Trees
  2. Red Black Tree Insertion
  3. Red-Black Trees Top-Down Insertion
  4. Deletion in Red-Black Trees
  5. Red-Black Tree (Delete)
  6. Insertion in Left-Leaning Red-Black Tree
  7. Check if a given Binary Search Tree is height-balanced like a Red-Black Tree
  8. Find the largest K for every Array element such that at least K prefixes are ≥ K


  1. Introduction and implementation of Trie
  2. Dictionaries using Tries
  3. Delete nodes from trie
  4. Advantages of Trie Data Structure
  5. Pattern Searching using Trie
  6. Longest word in dictionary
  7. Implement Forward DNS Look Up Cache
  8. Implement Reverse DNS Look Up Cache

Suffix Tree

  1. Suffix Array Construction (Brute Force N ^ 2 LogN)
  2. Suffix Trees (Implementation - Brute Force)
  3. Find the indices of all the occurrences of a pattern in a string
  4. Longest Palindromic Substring using a suffix tree


  1. Introduction to Graphs
  2. Graph Representation
  3. Implementation of Graph in Java
  4. Implementation of Graph in Python
  5. Graph Theory
  6. Graph Types and Applications
  7. Construct a Graph from the size of components of each node
  8. Graph And Tree
  9. Pendant Vertices, Non-Pendant vertices, Pendant Edges, and Non-Pendant Edges of the Graph.
  10. Properties of Graph
  11. Breadth-First Search
  12. Minimum length paths between 1 to N including each node
  13. Check if the given permutation is a valid BFS of a given tree
  14. Find integral points with minimum distance from given set of integers using BFS
  15. Implement Water Supply System
  16. 0-1 BFS
  17. 01 Matrix
  18. DFS Traversal of a Graph - Iteratively
  19. Check if there are at least T continuous blocks of 0s or not in a Binary Matrix
  20. Find Regions with Most Common Region Size in a Given Boolean Matrix
  21. Clone of an undirected graph
  22. Course Schedule
  23. Topological sort without Kahn’s algorithm
  24. Clone a Directed Acyclic Graph
  25. Word Ladder
  26. Minimum Cost Path in a directed graph via a given set of necessary nodes
  27. Stepping Numbers
  28. Print all paths from a given source to a destination
  29. Accounts Merge
  30. Euler and Hamiltonian Paths

Segment Tree

  1. Introduction to Segment Trees
  2. Segment Tree
  3. Merge Sort Tree For Range Order Statistics
  4. Length of Longest Increasing Subsequences (LIS) using Segment Tree
  5. Count of Xs in the Array for a given range of indices after array updates for Q queries
  6. Longest Subarray with GCD Greater than 1
  7. Count Substrings having Frequency of a Character Exceeding that of Another Character in a String
  8. Queries to Calculate the Sum of the Array Elements Consisting of an Odd Number of Divisors
  9. Queries to Calculate Sum of Squares of ASCII Values of Characters of a Substring with updates
  10. Queries to calculate sum of squares of array elements over range of indices [L, R] with updates
  11. Range Update in a Segment Tree without using Lazy Propagation and Point Query
  12. Queries to Count Array Elements from a Given Range having a Single Set Bit
  13. Queries to Find The First Array Element Exceeding K with Updates
  14. Maximize value of a pair from two given arrays based on given conditions
  15. Range minimum query
  16. Queries to find the min index in a range [L, R] having at least value ele with updates
  17. Queries to calculate sum with alternating signs of array elements in a given range
  18. Query to find the length of the longest subarray consisting of only 1s
  19. Maximize the length of longest subarray consisting of same elements by at most X decrements
  20. Maximum length of same indexed subarrays from two given arrays satisfying the given condition
  21. Queries to Count Array Elements Greater Than or Equal to a given Number with Updates
  22. Maximize sum of array by reducing array elements to contain no triplets (i, j, k) where a[i] < a[j] and a[i] < a[k] and j <i < k
  23. Queries to Evaluate the given Expression in a range [L, R]

Fenwick Tree

  1. Find Value After N Operations to Remove N Characters of String S with Given Constraints
  2. Sum of previous numbers that are greater than current number for given array
  3. Finding XOR of the Array Elements in a Given Range with Updates using Fenwick Tree
  4. Queries for the Number of Nodes having Values Less than V in the Subtree of a Node
  5. Count smaller elements on right side and greater elements on left side using Binary Index Tree
  6. Find the Number of Pair of Ideal Nodes in a Given Tree
  7. Range Sum Queries and Update with Square Root
  8. Number of elements greater than K in the range L to R using Fenwick Tree (Offline queries)
  9. Count of Inversion of size K in a given array
  10. XOR of Numbers that Appeared Even Number of Times in Given Range
  11. Sum of Interval and Update with Number of Divisors
  12. Maximum Sum of Increasing Subsequence using Fenwick Tree
  13. Queries for Number of Distinct Elements in the Subarray
  14. Number of Elements less than or equal to a given number in a given subarray
  15. Count Inversions using Fenwick Tree
  16. Two Dimensional Fenwick Tree
  17. Binary Indexed Tree or Fenwick Tree
  18. Range Update and Range Queries in Binary Indexed Tree
  19. Binary Indexed Tree: Range Update and Range Queries
  20. Querying the Number of Distinct Colors in a Subtree of a Colored Tree using BIT
  21. Minimum Possible Integer After at Most K Adjacent Swaps On Digits
  22. The Skyline Problem

Sparse Table

  1. Matchstick Problem
  2. Find the S-value of the Given Subarrays Using Mo’s Algorithm


  1. Implementing Sets Without C++ STL Containers
  2. Fair Candy Swap
  3. Count the total numbers with no repeated digits in a range
  4. Count of Isogram Strings in a Given Array of Strings with Length at Least K
  5. Maximize count of distinct elements in a subsequence of size K in given array
  6. Find numbers in the range [L, R] that are coprime with all given Array elements
  7. Count Of Pairs In Given Array Whose GCD Is Not Prime

Data Structures and Algorithms

We have already discussed data structures and now it is time to have a look at Algorithms and put the terms together as Data Structures and Algorithms to see why is it trending all over in the computer science community.


In mathematics and computer science, an algorithm is defined as the set of instructions/commands given to solve a problem. For example, giving instructions to a computer to sum 2 or more numbers, finding prime numbers from a bunch of given numbers, etc.

We have a variety of algorithms which are as follows:

  1. Algorithm Analysis
  2. Recursion
  3. Backtracking 
  4. Dynamic Programming
  5. Greedy Algorithms
  6. String Processing
  7. Divide and Conquer 
  8. Graph Algorithms
  9. Searching Techniques
  10. Sorting Techniques
  11. Branch and Bound Algorithms
  12. Bit Manipulation
  13. SQRT Decomposition

Algorithm Analysis

  1. Introduction of Time Complexity
  2. Introduction to Space Complexity
  3. Asymptotic Notations
  4. Time & Space Complexity for loops
  5. Trick questions from Time & Space Complexity
  6. Iteration Method
  7. Recursion Tree Method
  8. Interesting Questions from (Substitution, Iteration, Recursion Tree, Master)
  9. Time & Space Complexity of Searching Algorithms
  10. Time & Space Complexity of Sorting Algorithms (Quadratic time algorithms)
  11. Time & Space Complexity of Sorting Algorithms - 2 (N*logN)
  12. Time & Space Complexity of Graph Algo - 1
  13. Time & Space Complexity of Graph Algo - 2
  14. Time & Space Complexities of Graph Algo-3
  15. Time and Space Complexity of Linear Data Structures
  16. Time and Space Complexity of Non-Linear Data Structures
  17. Recursion & Backtracking Time Complexity


  1. Types Of Recursion
  2. Tail Recursion
  3. Different ways to add parentheses
  4. Josephus Problem
  5. Sum of the combination of numbers | Part-1
  6. Sum of the combination of numbers | Part-2
  7. How to find all the palindromic partitions of a string
  8. Rat In A Maze
  9. Word Search


  1. Backtracking and Recursion
  2. Min-Max Algorithm
  3. N-Queen
  4. Generate Parentheses
  5. Stone Game
  6. Sudoku Solver
  7. Word Break Problem using Backtracking
  8. Tug Of War
  9. Permutations
  10. Implement Hamiltonian Cycle
  11. Additive Number
  12. The K-th Lexicographical String of All Happy Strings of Length ‘N’
  13. Subsets
  14. Subsets (ii)

Dynamic Programming

  1. How to solve a dynamic programming problem?
  2. Memoization vs Tabulation
  3. Overlapping substructure vs overlapping sub problems
  4. Subsets
  5. 0-1 Knapsack
  6. Count Number of subsets with given Sum
  7. Subset Sum Problem
  8. Coin Change: Minimum Number Of Coins
  9. Unbounded Knapsack
  10. Target Sum
  11. Longest Common Subsequence
  12. Longest common substring
  13. Longest Palindromic Subsequence
  14. Minimum insertion to convert the string to a palindrome
  15. Longest Repeating Subsequence
  16. LCS of 3 strings
  17. Shortest Common Supersequence
  18. Distinct subsequences
  19. Regular Expression Matching
  20. Wildcard Matching
  21. Best time to buy and sell stock
  22. Best time to buy and sell stock II
  23. Best Time to Buy and Sell Stock III
  24. Best Time to Buy and Sell Stock with at most K Transactions
  25. Best time to buy and sell the stock with cooldown
  26. Edit Distance
  27. Wine Selling
  28. Maximum Product Subarray
  29. Maximum Area of the Square Submatrix
  30. Maximal Square

Greedy Algorithms

  1. Activity Selection problem and Greedy Algorithm-
  2. Job scheduling algorithm
  3. Huffman Encoding
  4. Gas Station
  5. Minimum Number of Platforms Required for a Railway/Bus Station
  6. Merge Intervals
  7. Maximum Disjoint Intervals
  8. Maximum number of overlapping intervals
  9. Shortest Unsorted Continuous Subarray
  10. Queue Reconstruction by Height
  11. Find maximum meetings in one room
  12. Reduce array to a single element by repeatedly removing an element from any increasing pair
  13. Next Permutation
  14. Minimize Cash Flow among a given set of friends who have borrowed money from each other
  15. Divide 1 to n into two groups with a minimum sum difference
  16. Fractional Knapsack Problem
  17. Minimum initial vertices to traverse the whole matrix with given conditions
  18. K Centers Problem
  19. Shortest Superstring
  20. Minimum Number of Arrows to Burst Balloons
  21. Find Minimum Number of Arrows Needed to Burst all Balloons
  22. Equilibrium Point
  23. Product of array except self
  24. Jump Game
  25. Jump Game II
  26. Boats to Save People
  27. Get Equal Substrings Within Budget
  28. Number of wonderful substrings

String Processing

  1. String Hashing
  2. Find All Occurrences of the Pattern in the String
  3. Minimum Repetitions of String A, to Generate String B as its Substring
  4. Shortest Palindrome
  5. Find the longest proper prefix that is also a suffix
  6. Repeated Substring Pattern

Divide and Conquer

  1. Introduction to the Divide and Conquer Algorithm
  2. Fast Fourier Transform for polynomial multiplication
  3. Fibonacci numbers
  4. Tiling Problem using Divide and Conquer algorithm
  5. Check if a number is a palindrome or not without using any extra space
  6. Count the number of inversions in an array using merge sort
  7. Reduce array to longest sorted array possible by removing either half of given array in each operation
  8. Merge two sorted arrays in O(1) extra space using QuickSort partition
  9. Koko Eating Bananas
  10. Count Negative Numbers in a Sorted Matrix
  11. How to find the minimum capacity of the ship to ship packages within d days.
  12. Sum of middle elements of two sorted arrays
  13. Longest Substring with At Least K Repeating Characters
  14. Median of Two Sorted Arrays
  15. Longest Common Prefix using Divide and Conquer Algorithm

Graph Algorithms

  1. Breadth First Search(BFS)
  2. Depth First Search(DFS)
  3. Properties of a Minimum Spanning Tree(MST)
  4. Kruskal’s Algorithm
  5. Minimum Cut on a Graph Using a Maximum Flow Algorithm
  6. Bellman Ford Algorithm
  7. Floyd Warshall Algorithm
  8. Kahn’s Algorithms
  9. DSatur Algorithm for Graph Coloring
  10. Bipartite Algorithm
  11. Print all Hamiltonian Cycles in an Undirected Graph

Searching Techniques

  1. Linear Search
  2. Binary Search
  3. Ternary Search
  4. Binary Search Vs Ternary Search

Sorting Techniques

  1. Bubble Sort
  2. Bubble Sort For Linked List By Swapping Nodes
  3. Merge Sort
  4. Quick Sort
  5. Radix Sort
  6. Bucket Sort
  7. Counting Sort
  8. Heap Sort

Branch and Bound Algorithms

  1. 0-1 Knapsack
  2. N-Queen Problem
  3. Travelling Salesman Problem | Part 1
  4. Travelling Salesman Problem | Part 2

Bit Manipulation

  1. Hamming Distance
  2. Total Hamming Distance
  3. Ugly Numbers 2
  4. Find Elements
  5. Bitwise AND of Numbers Range
  6. Longest Consecutive Sequence of 1’s in the Binary Representation of a Number
  7. Minimum X (xor) A
  8. Lucky Alive Person in a Circle
  9. Count Number of Set Bits in an Integer
  10. Gray Code
  11. Number of Steps to Reduce a Number in Binary Representation to One
  12. Divide Two Integers
  13. Bitwise Operators in C++
  14. Binary Numbers of N digits
  15. Generate All Binary Numbers in the Range [L, R]
  16. Find a Number X Such that XOR of Given Array after Adding X to Each Element is 0
  17. Convert given binary to its equivalent ASCII character string
  18. Count Set Bits in Index Range [L, R] in Given Array for Q Queries
  19. Count total set bits in an array
  20. Form a Number Using Bit Rotations of N having the Same Frequency of each Digit
  21. Maximize Bitwise AND of the array by replacing at most one element
  22. Bit Stuffing and Bit Destuffing
  23. Find the maximum product of Bitwise AND and Bitwise OR of K-size subarray
  24. Find the size of the largest subset with bitwise AND greater than their bitwise XOR
  25. Find the total number of subsequences having odd Bitwise AND values in the array
  26. Find the total number of subsequences having odd Bitwise OR values in the array
  27. Maximize sum of LSBs of Bitwise OR of all possible N/2 pairs from given Array
  28. Find the next greater number formed with exactly two unique digits for each array element

SQRT Decomposition

  1. Ninja’s Messenger
  2. Sqrt (Square Root) Decomposition
  3. Frequency Range Count

Why is Data Structures and Algorithms trending?

Data Structures and Algorithms is one of the hot topics now and is going to stay forever! Wondering why? It is because it tests your critical thinking skills. It serves as a foundation for your problem-solving skills with restricted resources and with at most efficiency which is something every product based giant and startup are looking for. It is there to stay! 

If you also dream to get into FAANG, start from today! Check out our courses on Data Structures and Algorithms.

  1. Data Structures and Algorithms offered in C++
  2. Data Structures and Algorithms offered in Java
  3. Data Structures and Algorithms offered in Python

Advantages Of Data Structures

Without a doubt, data structures and algorithms are critical for acing the tech giants interview rounds. The reason behind this are: 

  • Data structures help to organise information efficiently which is widely used in the digital space today. 
  • Good data structure approach allows quick manipulation of large amounts of data by saving lots of time while performing common operations like storage, processing and retrieval of data. 
  • One of the most important features of data structures is their reusability which further helps to minimise the redundancy in codes.

Disadvantages Of Data Structures

Along with so many advantages of data structures, there are some disadvantages too. Like - 

  • For managing operations related to data structures highly qualified professionals are needed. 
  • Complex algorithms may be involved while designing your own data structures which in turn also requires a lot of time and research. 
  • With the increase in the complexity of application or program, the number of data structures involved also increases. This leads to an increase in maintenance costs due to the requirement of skilled man power.

Applications of Data Structures

Data structures store information according to the mathematical or logical model on which they are built. The operations that can be performed on a data structure make it suitable for specific tasks. Here's a quick rundown of some of the most common uses for data structures.

Storage of Data

Specifying the attribute collections and associated structures used in database management systems to store records helps with facilitating efficient data persistence in data structures.

Exchange of Data

Data structures determine how organised information can be transferred across applications like TCP/IP packets.

Service and Resource Management

File directory management, memory allocation, and processing scheduling queues can all be performed using a linked list data structure, which can be used by basic operating system resources and services.


Data structures are used by big data applications to organise and assign data storage across multiple distributed storage locations. This function ensures maximum performance and scalability.

Follow Data Structures and Algorithms in C++, a free and comprehensive video series by Coding Ninjas, that covers each topic thoroughly.

Was this article helpful ?