Backtracking
Everything on SkillVeris tagged Backtracking — collected across the glossary, study notes, blog, and cheat sheets.
12 resources across 2 libraries
Study Notes(2)
Backtracking Explained
How Prolog recovers from failed goals and finds multiple solutions by returning to choice points, and what that means for how programs actually execute.
The Backtracking Paradigm
Learn how backtracking systematically builds candidate solutions and abandons paths that cannot possibly succeed.
Interview Questions(10)
What is Backtracking?
Backtracking is a systematic search technique that builds a solution incrementally, one choice at a time, and abandons ("backtracks" from) any partial path as…
N-Queens Problem: How Would You Solve It?
The N-Queens problem is solved with backtracking: place queens column by column, and at each row try every column, only proceeding if the position is not attac…
How Do You Find the Longest Common Subsequence?
The longest common subsequence (LCS) of two strings is the longest sequence of characters that appears in both strings in the same relative order but not neces…
How Does the Next Permutation Algorithm Work?
The next permutation algorithm rearranges a sequence in place into the lexicographically next greater permutation using O(n) time and O(1) extra space, by find…
Word Search Problem: How Would You Solve It?
Word search is solved with backtracking DFS: from every cell matching the word's first letter, recursively explore the four orthogonal neighbors while the next…
What is the Graph Coloring Problem?
Graph coloring assigns a label, or color, to every vertex of a graph so that no two adjacent vertices share the same color, and the goal is usually to do it wi…
What is the Hamiltonian Path Problem?
A Hamiltonian path is a path through a graph that visits every vertex exactly once, and finding one (or deciding one exists) is NP-complete in general, solved…
How Do You Solve the Palindrome Partitioning Problem?
Palindrome partitioning — splitting a string into the minimum number of cuts so every resulting piece is a palindrome — is solved with dynamic programming in O…
Word Break Problem: How Do You Solve It?
The word break problem — deciding whether a string can be segmented into a sequence of words from a given dictionary — is solved with dynamic programming where…
Iterative vs Recursive Algorithms: What is the Difference?
An iterative algorithm repeats a loop body while updating variables directly, using O(1) call-stack space, while a recursive algorithm solves a problem by call…