Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
6 views4 pages

Must Know Algorithms SDE SWE

Must know

Uploaded by

sahgalmedhavi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

Must Know Algorithms SDE SWE

Must know

Uploaded by

sahgalmedhavi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Must-Know Algorithms

Arrays
 Kadane’s Algorithm – Maximum subarray sum
 Two Pointers – Pair sum, remove duplicates
 Sliding Window – Max/min in subarrays
 Prefix Sum / Difference Array – Range queries
 Binary Search – Rotated array, bounds
 Dutch National Flag – Sort 0s, 1s, 2s

Strings
 KMP Algorithm – Pattern matching
 Z-Algorithm – Pattern search
 Rabin-Karp – String hashing
 Sliding Window – Anagram detection
 Manacher’s Algorithm – Longest palindrome
 Trie – Prefix matching

Linked List
 Floyd’s Cycle Detection
 Reverse Linked List (Iterative + Recursive)
 Merge Two Sorted Lists
 Find Middle Node
 Remove N-th Node from End
 Clone List with Random Pointers

Stacks
 Next Greater Element
 Balanced Parentheses Check
 Infix to Postfix Conversion
 Largest Rectangle in Histogram
 Monotonic Stack problems
Queues
 Sliding Window Maximum using Deque
 Rotten Oranges – BFS
 First Non-repeating Character
 Circular Queue Implementation

Binary Trees
 Inorder, Preorder, Postorder Traversal
 Level Order Traversal (BFS)
 Height, Diameter, Balanced Check
 Lowest Common Ancestor (LCA)
 View Problems: Top, Bottom, Left, Right
 Mirror/Symmetric Tree
 Validate BST

Binary Search Trees (BST)


 Insert, Delete, Search
 Floor and Ceil in BST
 Kth Smallest/Largest
 Convert BST to DLL
 Validate BST

Heaps / Priority Queue


 Heapify, Insert, Delete
 K Largest / Smallest Elements
 Median in Stream
 Merge K Sorted Lists
 Top K Frequent Elements

Hashing
 Two Sum / Subarray Sum
 Longest Substring Without Repeats
 Count Distinct Elements
 Group Anagrams
 Frequency Map Techniques
Recursion & Backtracking
 Permutations & Combinations
 Subsets / Power Set
 N-Queens Problem
 Sudoku Solver
 Rat in a Maze
 Word Search in Matrix

Dynamic Programming
 0/1 Knapsack and Variants
 Fibonacci (Memo & Tabulation)
 LCS / LIS
 Matrix Chain Multiplication
 Subset Sum / Equal Partition
 Edit Distance
 Rod Cutting
 Coin Change Problems

Graphs
 BFS / DFS
 Topological Sort
 Cycle Detection (Directed/Undirected)
 Shortest Path: Dijkstra, Bellman-Ford, Floyd-Warshall
 MST: Prim’s and Kruskal’s
 Union-Find (DSU)
 Bridges / Articulation Points
 Kosaraju’s Algorithm (SCC)now

Greedy Algorithms
 Activity Selection
 Fractional Knapsack
 Huffman Coding
 Job Sequencing
 Minimum Platforms
 Greedy Coin Change
Sliding Window / Two Pointer
 Longest Substring Without Repeats
 Minimum Window Substring
 Subarray With Given Sum
 Max Sum Subarray of Size K

Bit Manipulation
 Check Odd/Even
 Set/Clear/Toggle Bits
 Count Set Bits
 Find Unique Element (XOR)
 Subset Generation using Bitmask
 Power of Two

You might also like