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.

Updated 17 Nov 20265 min readDSA & Algorithms

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.

Updated 16 Nov 20266 min readDSA & Algorithms

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.

Updated 15 Nov 20265 min readDSA & Algorithms

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.

Updated 14 Nov 20265 min readDSA & Algorithms

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.

Updated 13 Nov 20266 min readDSA & Algorithms

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.

Updated 13 Nov 20266 min read96 viewsDSA & Algorithms

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.

Updated 12 Nov 20265 min readDSA & Algorithms

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.

Updated 11 Nov 20265 min readDSA & Algorithms

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.

Updated 10 Nov 20266 min readDSA & Algorithms

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.

Updated 9 Nov 20265 min readDSA & Algorithms

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.

Updated 8 Nov 20266 min readDSA & Algorithms

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.

Updated 6 Nov 20265 min readDSA & Algorithms