This repository contains a collection of data structures and algorithms organized by categories and specific problems. It aims to provide solutions and insights into a wide range of topics, from basic to advanced levels.
- LinkedList
- Reverse Linked List using recursion and iteration
- Reverse K groups in a Linked List
- Stack
- Queue
- Arrays
- Sorting
- Binary Search
- Linked List
- Binary Tree
- Binary Search Tree
- Heaps
- Kth largest sum in subarray
- Merge K sorted arrays
- Merge K sorted Linked Lists
- Tries
- Search Bar
- Graphs
- DFS/BFS Traversal of Graphs
- Detect Cycle in Directed Graphs
- Detect Cycle in Undirected Graphs
- Topological Sort using DFS
- Topological Sort using BFS - Kahn's Algorithm
- Shortest Path in Undirected Graph
- Shortest Path in Directed Graph (DAG) - using Topological Sort
- Dijkstra Algorithm for Shortest Path
- Prim's Algorithm for Minimum Spanning Tree (MST)
- Kruskal's Algorithm
- Morris Traversal (BT, BST)
- Largest Rectangle in matrix - Histogram Approach - Stack
- N stacks in an array (Redo, stack) - Advance Question
- Merge K sorted arrays
- Merge K sorted Linked Lists
Details and solutions for various linked list problems.
Description and solution for the Rat in a Maze problem.
Implementation details for designing a special stack.
Algorithm to find the area of a histogram using stacks.
Solution for identifying the celebrity in a matrix.
Approach to find the largest rectangle in a matrix using histograms.
Advanced problem on implementing N stacks in an array.
Details and solutions for various queue problems.
Details and solutions for various array problems.
Implementation and explanation of the Merge Sort algorithm.
Implementation and explanation of the Quick Sort algorithm.
Solution for the Painter's Partition Problem using binary search.
Binary search approach to solve the book allocation problem.
Binary search solution for the cow stalls problem.
Finding the peak element in an array using binary search.
Identifying the pivot element in an array using binary search.
Solution for cloning a linked list with random pointers.
Algorithm to find the diameter of a binary tree.
Method to traverse the boundary of a binary tree.
Explanation and implementation of Morris Traversal for binary trees.
Solution for the vertical order traversal of a binary tree.
Algorithm to merge two binary search trees.
Solution to find the Kth largest sum in a subarray.
Algorithm to merge K sorted arrays.
Algorithm to merge K sorted linked lists.