∑GateAndNet
PlannerSign Up
⚡GATE CSWeightage: 8–10 Marks9 Study Chapters18 Solved PYQs

Algorithms

Asymptotic notation, Master theorem, sorting, greedy, dynamic programming & graph algorithms.

Practice Unit PYQs (18)All GATE CS Units
Official Syllabus Micro-Topics
Asymptotic Worst/Average Case Time & Space Complexity: O, Omega, Theta, o, omega notationsRecurrence Relations: Substitution, Recursion Tree & Master TheoremSearching & Sorting: Binary Search, Merge Sort, Quick Sort, Heap Sort, Counting/Radix SortGreedy Algorithms: Fractional Knapsack, Activity Selection, Huffman CodingMinimum Spanning Trees (MST): Prim’s & Kruskal’s Algorithms, Cut & Cycle PropertiesSingle-Source & All-Pairs Shortest Paths: Dijkstra, Bellman-Ford, DAG Shortest Path, Floyd-WarshallDynamic Programming: 0/1 Knapsack, Longest Common Subsequence (LCS), Matrix Chain MultiplicationGraph Traversals: BFS, DFS (Tree/Back/Forward/Cross Edges), Topological Sort, Strongly Connected Components

Published Study Notes & Chapters (9)

Ch 1 High Yield 4 min read 1 PYQs

Asymptotic Notation & Master Theorem for Divide-and-Conquer

Big-O, Omega, Theta bounds and solving divide-and-conquer recurrences in under 30 seconds.

Read Chapter
Ch 2 4 min read 3 PYQs

Shortest Path & MST Algorithms: Dijkstra, Bellman-Ford, Prim & Kruskal

Edge relaxation, negative edge traps, Disjoint-Set Union Kruskal complexity, and MST uniqueness theorem.

Read Chapter
Ch 3 High Yield 4 min read 3 PYQs

Dynamic Programming Masterclass: 0/1 Knapsack, LCS & Matrix Chain Multiplication

Optimal substructure & overlapping subproblems, exact DP recurrences, time/space complexities, and pseudo-polynomial complexity of 0/1 Knapsack.

Read Chapter
Ch 4 High Yield 4 min read 3 PYQs

Sorting Bounds, Stability, Inversions & P / NP / NP-Complete Reductions

Decision-tree Omega(n log n) lower bound, stability & in-place comparison table, counting array inversions, and polynomial-time Karp reductions (P, NP, NP-Hard, NP-Complete).

Read Chapter
Ch 5 High Yield 4 min read 2 PYQs

Famous Sorting Algorithms (Animated): Bubble, Selection, Insertion, Merge, Quick & Heap Sort

Interactive animated traces, exact comparison/swap counts, inversion bounds, Lomuto vs Hoare QuickSort partitioning, Merge Sort divide-and-conquer, and O(n) Build-Heap proof.

Read Chapter
Ch 6 High Yield 4 min read 1 PYQs

Non-Comparison Linear Sorting (Counting, Radix, Bucket) & O(n) Order Statistics

Beating the Omega(n log n) decision-tree bound with key-indexed Counting Sort, LSD Radix Sort stability requirement, Bucket Sort expected O(n), and deterministic O(n) Median-of-Medians.

Read Chapter
Ch 7 High Yield 4 min read 2 PYQs

Searching & String Pattern Matching (Animated): Binary, Interpolation, Rabin-Karp & KMP

Overflow-safe Binary Search loop invariants, Rotated Array & Ternary Search, O(log log n) Interpolation Search, Rabin-Karp rolling modular hash & spurious hits, and animated KMP LPS matching.

Read Chapter
Ch 8 High Yield 4 min read 1 PYQs

Graph Algorithms & Logics (Animated): BFS/DFS Edges, Topological Sort, SCCs & Dijkstra/Bellman-Ford

Animated BFS FIFO queue vs DFS LIFO stack, DFS parenthesis theorem & Back-Edge cycle detection, Kahn vs DFS topological sort, Kosaraju SCCs, and Dijkstra vs Bellman-Ford negative weight traps.

Read Chapter
Ch 9 High Yield 4 min read 2 PYQs

Famous Algorithms & Proofs: Max-Flow Min-Cut, Huffman Trees, Kadane, Edit Distance & Cycle Detection

Ford-Fulkerson residual networks & Edmonds-Karp O(VE^2) bound, Max-Flow Min-Cut theorem, Huffman optimal prefix code tree properties, Kadane O(n) subarray, Levenshtein DP, and Floyd cycle pointer math.

Read Chapter

Solved Algorithms PYQs & Practice Questions

Launch Timed Mock (18 Qs)
Q1GATE CS 2023AlgorithmsMCQMEDIUM
+2M • -0.67

Consider the recurrence relation T(n)=8 T ⁣(n2)+n3log⁡2nT(n) = 8\,T\!\left(\frac{n}{2}\right) + n^3 \log_2 n for n>1n > 1 and T(1)=1T(1) = 1. Which of the following is the tightest asymptotic bound for T(n)T(n)?

⚡ Click an option above to verify instantly
Q2GATE CS 2020AlgorithmsNATMEDIUM
+2M • 0 Neg

The complete undirected graph K6K_6 (66 labeled vertices) has how many distinct Spanning Trees (by Cayley’s Formula)?

Q3GATE CS AlgorithmsAlgorithmsMCQMEDIUM
+2M • -0.67

Five characters have frequencies 5,9,12,13,165, 9, 12, 13, 16. Using Huffman optimal prefix coding, what is the total weighted number of bits required to encode all 5555 characters?

⚡ Click an option above to verify instantly
Q4GATE CS AlgorithmsAlgorithmsMCQMEDIUM
+2M • -0.67

What is the worst-case time complexity of Dijkstra’s single-source shortest path algorithm on a graph G=(V,E)G = (V, E) implemented using a Binary Min-Heap adjacency list?

⚡ Click an option above to verify instantly
Q5GATE CS 2019AlgorithmsNATEASY
+2M • 0 Neg

What is the length of the Longest Common Subsequence (LCS) between strings X = "AGGTAB" and Y = "GXTXAYB"?

Q6GATE CS 2016AlgorithmsNATMEDIUM
+2M • 0 Neg

What is the minimum number of scalar multiplications required to multiply four matrices M1(10×20),  M2(20×50),  M3(50×1),  M4(1×100)M_1(10 \times 20),\; M_2(20 \times 50),\; M_3(50 \times 1),\; M_4(1 \times 100)?

Q7GATE CS AlgorithmsAlgorithmsMCQMEDIUM
+2M • -0.67

What is the length of the Longest Common Subsequence (LCS) of strings X="AGGTAB"X = \text{"AGGTAB"} and Y="GXTXAYB"Y = \text{"GXTXAYB"}?

⚡ Click an option above to verify instantly
Q8GATE CS 2025 MSQAlgorithmsMSQMEDIUM
+2M • 0 Neg

Assume P≠NP\mathbf{P \neq NP}. Which of the following complexity-theoretic statements are TRUE?

☑️ Multiple Select Question — pick one or more options, then click Check Answer.
Solve All 18 Algorithms Questions
Other Units in GATE Computer Science & Information Technology (GATE CS)
∑ Engineering Mathematics & Discrete Math🔌 Digital Logic🏗️ Computer Organization & Architecture💻 Programming & Data Structures⚡ Algorithms🔄 Theory of Computation🛠️ Compiler Design⚙️ Operating Systems🗄️ Databases (DBMS)🌐 Computer Networks🧭 General Aptitude (Mandatory)