powered by v43.aiशरीर रचना, एक कलाकार की तरहDSA
Practise algorithms and data structures through animated models. Advanced enrichment topics.
0 of 14 topics mastered
Explore → practise → quiz → revise. Earlier topics are recommended preparation; every topic stays open.
Start here: Radix sort →- Radix sortUp next
- Tries / prefix treesExplore
- Dijkstra shortest pathsExplore
- Topological sortingExplore
- Union–find / disjoint setsExplore
- 0/1 knapsackExplore
- Longest common subsequenceExplore
- Coin change / minimum coinsExplore
- N-Queens / backtrackingExplore
- Fenwick trees / prefix queriesExplore
- Segment trees / range sumsExplore
- Kruskal / minimum spanning treeExplore
- Bellman–Ford shortest pathsExplore
- KMP string matchingExplore
Radix sort
DSA enrichmentSort nonnegative integers digit by digit, starting with the least significant decimal digit. Each digit pass uses stable buckets.
Tries / prefix trees
DSA enrichmentInsert words character by character, reusing shared prefixes. A terminal marker records a complete word even when that word is also a prefix of another.
Dijkstra shortest paths
DSA enrichmentRepeatedly settle the unsettled vertex with minimum tentative distance, then relax its outgoing edges. The fixed graph has only nonnegative weights. This trace uses a linear scan to select the minimum.
Topological sorting
DSA enrichmentUse Kahn’s algorithm on a fixed directed acyclic graph. Remove zero-indegree vertices and reduce their outgoing neighbours’ indegrees.
Union–find / disjoint sets
DSA enrichmentProcess undirected edges, find the root of each endpoint and merge distinct components. Union by rank and path compression keep trees shallow.
0/1 knapsack
DSA enrichmentChoose from four fixed items with weights 2,3,4,5 and values 3,4,5,8. Each item can be used at most once. A table records the best value for each item prefix and capacity.
Longest common subsequence
DSA enrichmentCompare two strings, separated by |. A subsequence preserves order but may skip characters; it need not be contiguous. The table returns the LCS length.
Coin change / minimum coins
DSA enrichmentFind the fewest coins for an exact target, with unlimited uses of each positive denomination. Unreachable states remain ∞. Zero denominations are not allowed.
N-Queens / backtracking
DSA enrichmentPlace one queen per row so no two share a column or diagonal. Try a column, recurse to the next row, and undo a placement if the branch fails. Stop at the first solution.
Fenwick trees / prefix queries
DSA enrichmentBuild a one-based binary indexed tree, then query the first k values. Each node stores a block whose length is its least significant set bit.
Segment trees / range sums
DSA enrichmentBuild a binary hierarchy of interval sums, then query the first k values. A fully covered segment contributes its stored sum; a disjoint segment contributes zero.
Kruskal / minimum spanning tree
DSA enrichmentSort the fixed connected undirected graph’s weighted edges and accept an edge only when it joins different components. Stop after V−1 accepted edges.
Bellman–Ford shortest paths
DSA enrichmentRelax every edge repeatedly on a directed graph that includes a negative edge but no negative cycle. A final extra pass checks for a reachable negative cycle.
KMP string matching
DSA enrichmentSearch text for a pattern, separated by |. Build the pattern’s longest-prefix-suffix table, then reuse it on mismatches without moving the text pointer backwards. Matching is case-sensitive.