DSA & Algorithms
106 articles in this topic
Radix Sort and Counting Sort: Worked Examples, Complexity and Exam Traps
See how counting sort builds cumulative positions and how LSD radix sort depends on stable digit passes. Two traced examples turn formulas and exam traps into checks you can reproduce.
Number-Theoretic Algorithms for GATE CS: Modular Arithmetic, GCD and Primality Tests
Build a reliable number-theory toolkit through fixed examples: residues, Euclid and inverses, fast modular powers, exact primality checks and witness tests.
Master Theorem for GATE CS: Cases, Worked Recurrences and Exam Traps
Learn a repeatable way to classify divide-and-conquer recurrences. Work through all three cases, exact arithmetic, non-applicable forms, and common traps.
Iterative Loops in C for GATE: Code Traces, Worked Examples and Exam Traps
Learn a mechanical method for tracing C loops. Work through exact values, invariants, nested-loop counts, complexity, termination bugs, and output traps.
Single-Source Shortest Path (SSSP) Algorithms Compared: Worked Example and Exam Traps
Choose the right SSSP algorithm by tracing one six-vertex graph with BFS, DAG relaxation, Dijkstra and Bellman-Ford, then test the common traps.
Prim's Algorithm and Minimum Spanning Tree: Worked Example, Complexity and Exam Traps
Learn what makes Prim's greedy choice safe, trace every key update on a six-vertex graph, and avoid the mistakes that derail MST questions.
GATE 2012 Algorithm Questions: Topic Map and Worked PYQs
Turn the five currently tagged GATE 2012 Algorithm items into a revision plan, with worked concepts and the official Code A outcomes kept separate.
Floyd-Warshall and Subset Sum: Dynamic Programming Tables, Worked Examples and Exam Traps
Trace a four-vertex Floyd-Warshall matrix and a complete subset-sum table for target 9. Learn the state boundaries, loop order, reconstruction steps and common traps.
Matrix Chain Order: DP Recurrence, Table and a 4-Matrix Worked Example
See why order changes scalar cost even when the final matrix does not. Build both DP tables for p = [5, 10, 3, 12, 5] and recover the 405-cost solution.
Longest Common Subsequence (LCS): Build the DP Table Step by Step
Build an LCS table from its prefix state, trace every important cell, and backtrack one valid answer. The worked example ends with GTAB.
Fractional Knapsack Explained: Greedy Logic, Worked Example and Exam Traps
Learn why ratio order is optimal for divisible items, trace every step of a capacity-50 solution, and avoid common greedy and arithmetic mistakes.
Growth Rate Comparisons: How to Order Functions Step by Step
Learn how to normalise and order logarithmic, polynomial, exponential, and factorial functions without letting a small-value table mislead you.













