---
title: "#backtracking articles | Hashnode"
description: "Explore 78 articles tagged #backtracking on Hashnode. Tutorials, guides, and how-tos from the community."
url: "https://hashnode.com/tag/backtracking"
---

Tag

# #backtracking

78 posts · 1 followers

[Alex Mateo](https://hashnode.com/@alexmateo) · [Jul 1](https://hashnode.com/posts/n-queens-is-just-subsets-with-one-extra-line/6a44e9a744e24959d0637eea)

### [N-Queens Is Just Subsets With One Extra Line](https://alexmateo.hashnode.dev/n-queens-is-just-subsets-with-one-extra-line?utm_source=hashnode&utm_medium=feed)

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](https://alexmateo.hashnode.dev/n-queens-is-just-subsets-with-one-extra-line?utm_source=hashnode&utm_medium=feed)

[Abstract Algorithms](https://hashnode.com/@abstractalgorithms) · [Mar 9](https://hashnode.com/posts/backtracking-explained/69ae361bfa75b812d26fc599)

### [Exploring Backtracking Techniques in Data Structures](https://abstractalgorithms.hashnode.dev/backtracking-explained?utm_source=hashnode&utm_medium=feed)

Backtracking is a brute-force algorithmic technique that solves problems by trying to build a sol...

13 min read · [abstractalgorithms.hashnode.dev](https://abstractalgorithms.hashnode.dev/backtracking-explained?utm_source=hashnode&utm_medium=feed)

[Sk Shoyeb](https://hashnode.com/@skshoyebjs) · [Feb 26](https://hashnode.com/posts/rat-in-a-maze-problem-solvedjavascript-backtracking/699ffa59c9015c37f6ee34a3)

### [Rat In A Maze Problem SolvedJavaScript Backtracking](https://skshoyebjavascript.hashnode.dev/rat-in-a-maze-problem-solvedjavascript-backtracking?utm_source=hashnode&utm_medium=feed)

In 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 Solution

3 min read · [skshoyebjavascript.hashnode.dev](https://skshoyebjavascript.hashnode.dev/rat-in-a-maze-problem-solvedjavascript-backtracking?utm_source=hashnode&utm_medium=feed)

[Sk Shoyeb](https://hashnode.com/@skshoyebjs) · [Feb 24](https://hashnode.com/posts/all-string-permutations-backtracking-method-javascript-solution/699dbe82be438c0ca236e046)

### [All String Permutations - Backtracking Method - JavaScript Solution](https://skshoyebjavascript.hashnode.dev/all-string-permutations-backtracking-method-javascript-solution?utm_source=hashnode&utm_medium=feed)

In 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 class

2 min read · [skshoyebjavascript.hashnode.dev](https://skshoyebjavascript.hashnode.dev/all-string-permutations-backtracking-method-javascript-solution?utm_source=hashnode&utm_medium=feed)

[Bikash Mainali](https://hashnode.com/@bikash8848) · [Jan 6](https://hashnode.com/posts/dfs-traversal-for-undirected-unweighted-graph/695c787fc30bb3b03ec6562c)

### [Depth First Search (DFS) Traversal: for Undirected Unweighted Graph](https://dsa-3956.hashnode.dev/dfs-traversal-for-undirected-unweighted-graph?utm_source=hashnode&utm_medium=feed)

DFS 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](https://dsa-3956.hashnode.dev/dfs-traversal-for-undirected-unweighted-graph?utm_source=hashnode&utm_medium=feed)

[CHAO DU](https://hashnode.com/@chaos789) · [Oct 22, 2025](https://hashnode.com/posts/leetcode-39-combination-sum-backtracking-java-with-trace-tree/68f8ac0891ec2bfc92101e3d)

### [LeetCode 39 · Combination Sum — Backtracking (Java) with Trace Tree](https://leetlog-by-chao.hashnode.dev/leetcode-39-combination-sum-backtracking-java-with-trace-tree?utm_source=hashnode&utm_medium=feed)

Master LeetCode 39 Combination Sum with this clear Java backtracking guide. Includes recursion logic, pruning strategy, and a visual decision tree to help y

4 min read · [leetlog-by-chao.hashnode.dev](https://leetlog-by-chao.hashnode.dev/leetcode-39-combination-sum-backtracking-java-with-trace-tree?utm_source=hashnode&utm_medium=feed)

[Rajesh Gurajala](https://hashnode.com/@rajesh6) · [Sep 27, 2025](https://hashnode.com/posts/recursion/68d79acd5b7a2486bcb02a6f)

### [Recursion](https://learning-dsa.hashnode.dev/recursion?utm_source=hashnode&utm_medium=feed)

A 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](https://learning-dsa.hashnode.dev/recursion?utm_source=hashnode&utm_medium=feed)

[Pratik Kumar](https://hashnode.com/@pratik-kr) · [Sep 18, 2025](https://hashnode.com/posts/introduction-to-backtracking/68cc5ea67a1ae8d2d88a3cab)

### [Introduction to Backtracking](https://backtracking.hashnode.dev/introduction-to-backtracking?utm_source=hashnode&utm_medium=feed)

Backtracking 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](https://backtracking.hashnode.dev/introduction-to-backtracking?utm_source=hashnode&utm_medium=feed)

[Shichun Min](https://hashnode.com/@shichun) · [Sep 10, 2025](https://hashnode.com/posts/cs50-ai-with-python-lecture-3-optimization/68c10c5ac049bcffd71a373e)

### [CS50 AI with Python - Lecture 3: Optimization](https://ai-learning-shichun.hashnode.dev/cs50-ai-with-python-lecture-3-optimization?utm_source=hashnode&utm_medium=feed)

Notes and Takeaways

7 min read · [ai-learning-shichun.hashnode.dev](https://ai-learning-shichun.hashnode.dev/cs50-ai-with-python-lecture-3-optimization?utm_source=hashnode&utm_medium=feed)

[João Marcos Carniel](https://hashnode.com/@joaomarcoscarniel) · [Aug 22, 2025](https://hashnode.com/posts/backtracking/68a8fadc6cf9a021ded552c3)

### [Backtracking](https://joaodeveloper.hashnode.dev/backtracking?utm_source=hashnode&utm_medium=feed)

How 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](https://joaodeveloper.hashnode.dev/backtracking?utm_source=hashnode&utm_medium=feed)
