Posts

Showing posts from June, 2022

Merge Sort

Image

Index

Stacks     Implement 2 stacks in a array     Next Greater Element       Stack using queues     Largest Rectangle in Histogram Queues Recursion      Minimum number of jumps to reach end     Find all permutations of a string      Subset Sum      Tower of Hanoi     Climb Stairs Linked List      Reverse Linked List        Reverse Linked List -- In groups of k Nodes      Linked List -- Pairwise Swap     LRU Cache Bitwise     Little Vs Big Endian     Power set Sorting     1. Bubble Sort     2. Insertion Sort     3. Selection Sort     4. Shell Sort     5. Merge Sort     6. Quick Sort   Trees Binary Tree Traversals PreOrder Traversal InOrder Traversal PostOrder Traversal Level Order Traversal Vertical Sum Graphs Breadth First Search(BFS) Depth ...

Trees

 Trees

Sorting

Selection Sort: Take out the curr elem and compare with all elements to the right to find smallest elem.  Swap curr and smallest. arr[] = {9, 6, 7, 5, 2};