AAlex Mateo·Jul 1N-Queens Is Just Subsets With One Extra Line N-Queens, Sudoku and subsets are the same backtracking template. The only difference is one pruning line, and here's how to see it.4 min read·alexmateo.hashnode.dev
AAbstract Algorithms·Mar 9Exploring Backtracking Techniques in Data StructuresBacktracking is a brute-force algorithmic technique that solves problems by trying to build a sol...13 min read·abstractalgorithms.hashnode.dev
SSk Shoyeb·Feb 26Rat In A Maze Problem SolvedJavaScript BacktrackingIn this article we will solve Rat in a maze problem with backtracking. The rat start point is (0,0) and exit point is (n-1, n-1). The rat can move to 1 and 0 is blocked. Diagram Code class Solution3 min read·skshoyebjavascript.hashnode.dev
SSk Shoyeb·Feb 24All String Permutations - Backtracking Method - JavaScript SolutionIn this article we will solve the all string permutation problem with javascript by backtracking method. We will generate the solution tree and write the code accordingly, Solution Tree Code class2 min read·skshoyebjavascript.hashnode.dev
BBikash Mainali·Jan 6Depth First Search (DFS) Traversal: for Undirected Unweighted GraphDFS Traversal — 4 Easy Rules Rule 1 — Start Put the starting vertex into a stack Keep an empty visited set stack.push(start); Set<Integer> visited = new HashSet<>(); Rule 2 — Take from Stack While the stack is not empty: Pop the top vertex fro...7 min read·dsa-3956.hashnode.dev
CCHAO DU·Oct 22, 2025LeetCode 39 · Combination Sum — Backtracking (Java) with Trace TreeMaster LeetCode 39 Combination Sum with this clear Java backtracking guide. Includes recursion logic, pruning strategy, and a visual decision tree to help y4 min read·leetlog-by-chao.hashnode.dev
RRajesh Gurajala·Sep 27, 2025RecursionA function calls itself until specific condition is met. Example: void print(int now, int target){ if(now==target) return; cout<<now<<endl; print(now+1, target); } int main(){ print(1,11); return 0; } What if there’s no if condi...4 min read·learning-dsa.hashnode.dev
PPratik Kumar·Sep 18, 2025Introduction to BacktrackingBacktracking is “Recursion + Pass by Reference + Undoing the change after function call” Pseudo Code: void backtrackingFunction(...params){ if(invalid) return; if(valid){ ans.push(value); return; } --- Do the operatio...1 min read·backtracking.hashnode.dev
SShichun Min·Sep 10, 2025CS50 AI with Python - Lecture 3: OptimizationNotes and Takeaways7 min read·ai-learning-shichun.hashnode.dev
JJoão Marcos Carniel·Aug 22, 2025BacktrackingHow to use Backtracking in simple problems When using backtracking we basically want to “take pictures” of a certain state of our list, object, etc. This “pictures” we save in another list and after we follow two paths. In the first one we increment ...2 min read·joaodeveloper.hashnode.dev