AntInLoop

Interactive Algorithm Games

Build real algorithmic intuition by predicting the next visited node, priority-queue extraction, prefix jump, or union operation under exact algorithm rules.

  • BFS Game (O(V + E)) — Practice Breadth-First Search by predicting the next visited node in real time using FIFO queue traversal rules.
  • DFS Game (O(V + E)) — Practice Depth-First Search by predicting the next visited node and recursive backtracking steps across graphs.
  • Dijkstra's Algorithm Game (O((V + E) log V)) — Master Dijkstra's shortest path algorithm by predicting priority-queue extractions and edge relaxations on weighted graphs.
  • Floyd-Warshall Game (O(V^3)) — Practice all-pairs shortest paths by predicting which distance matrix entries update at each intermediate vertex k.
  • KMP String Matching Game (O(n + m)) — Master Knuth-Morris-Pratt pattern matching and the LPS prefix table by predicting matches and fallback jumps.
  • Sieve of Eratosthenes Game (O(n log log n)) — Practice prime number generation by predicting the next composite multiple crossed out by the Sieve of Eratosthenes.
  • Suffix Array Game (O(n log n)) — Learn suffix array construction by predicting the lexicographical ordering of string suffixes step by step.
  • Sparse Table Game (O(n log n) build, O(1) query) — Practice building a Sparse Table and answering O(1) Range Minimum Queries using overlapping power-of-two intervals.
  • Union-Find (DSU) Game (O(alpha(n)) amortized) — Practice Disjoint Set Union (DSU) operations including path compression and union by rank interactively.
  • GCD Game (O(log min(a, b))) — Practice the Euclidean Algorithm by predicting every modulo transition when computing the Greatest Common Divisor.
  • LCM Game (O(log min(a, b))) — Two-phase interactive math game: compute GCD via the Euclidean algorithm, then derive the Least Common Multiple.