Namaste DSA Guides
Master Data Structures and Algorithms with in-depth practical guides.
Topics Covered
How to Reverse a Linked List
A step-by-step guide on how to safely reverse a singly linked list using three pointers.
How to Implement Binary Search
Learn how to write an O(log N) binary search algorithm to instantly find elements in a sorted array.
How to Traverse a Graph using DFS
How to implement Depth First Search to explore deeply into graph networks.
How to Detect a Cycle in a Linked List (Floyd's Algorithm)
A step-by-step guide on how to detect a cycle in a linked list using Floyd's two-pointer Tortoise and Hare algorithm.
How to Implement a Least Recently Used (LRU) Cache
A step-by-step guide on how to build an LRU Cache using a Hash Map and a Doubly Linked List to achieve constant time operations.
How to Find the Shortest Path in an Unweighted Graph (BFS)
A step-by-step guide on how to use Breadth First Search to find the shortest path between two nodes in an unweighted graph.
How to Balance a Binary Search Tree (AVL Trees)
A step-by-step guide on how AVL Trees self-balance after every insertion and deletion using height tracking and rotations.
How to Solve the Knapsack Problem using Dynamic Programming
A step-by-step guide on how to solve the 0/1 Knapsack Problem by building a bottom-up Dynamic Programming table.
How to Implement a Priority Queue using a Min-Heap
A step-by-step guide on how to build a Priority Queue backed by a Min-Heap stored as an array with efficient insert and extract operations.
How to Perform Topological Sorting on a Directed Acyclic Graph
A step-by-step guide on how to perform topological sorting using Kahn's Algorithm with In-Degree tracking and a Queue.
How to Implement Binary Search Tree Insertion and Deletion
A step-by-step guide on how to correctly insert and delete nodes in a Binary Search Tree while maintaining its ordering property.
How to Implement Merge Sort
A step-by-step guide on how to implement the Merge Sort algorithm using the divide and conquer strategy to sort an array in O(N log N) time.
How to Implement Quick Sort
A step-by-step guide on how to implement Quick Sort using pivot selection and the partition technique to sort arrays efficiently.
How to Implement a Stack using Arrays and Linked Lists
A step-by-step guide on how to build a Stack data structure from scratch using both an Array and a Linked List approach.
How to Implement a Queue using Stacks
A step-by-step guide on how to simulate Queue behavior using two Stacks to achieve efficient enqueue and dequeue operations.
How to Find All Subsets of an Array (Power Set)
A step-by-step guide on how to generate all possible subsets of an array using both the recursive backtracking approach and the iterative bit manipulation approach.
How to Solve Two Sum and Its Variations
A step-by-step guide on how to solve the Two Sum problem and its common variations using Hash Maps and the Two Pointer technique.
How to Implement a Trie Data Structure
A step-by-step guide on how to build a Trie for efficient string storage, prefix searching, and autocomplete functionality.
How to Find the Lowest Common Ancestor in a Binary Tree
A step-by-step guide on how to find the Lowest Common Ancestor of two nodes in a Binary Tree using recursive depth first traversal.
How to Implement the Sliding Window Technique
A step-by-step guide on how to use the Sliding Window technique to solve subarray and substring problems efficiently in linear time.
How to Solve Problems using Dynamic Programming on Strings
A step-by-step guide on how to approach and solve classic string DP problems like Longest Common Subsequence and Edit Distance.
How to Traverse a Binary Tree (All Four Ways)
A step-by-step guide on how to perform Inorder, Preorder, Postorder, and Level Order traversal on a Binary Tree.
How to Detect and Remove Duplicates in an Array
A step-by-step guide on how to detect and remove duplicate elements from an array using Hash Sets, Sorting, and Two Pointers.
How to Find the Kth Largest Element in an Array
A step-by-step guide on how to find the Kth largest element efficiently using sorting, Min-Heap, and the QuickSelect algorithm.
