Data Structure
Java
Python
HTML
Interview Preparation
Tutorials
Courses
Tracks
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
Similar Topics
Web Technologies
32.1K+ articles
DSA
20.0K+ articles
Matrix
744+ articles
Graph
562+ articles
DFS
360+ articles
BFS
228+ articles
Backtracking
157+ articles
Algorithms-Dynamic Programming
128+ articles
Algorithms-Recursion
51+ articles
C-String-Question
28+ articles
Algorithms-Backtracking
17 posts
Recent Articles
Popular Articles
Commonly Asked Interview Questions on Backtracking
Last Updated: 13 September 2025
In interviews, backtracking problems often involve recursively exploring different configurations, making it ideal for solving problems like combinations, permutations, n-...
read more
DSA
Algorithms-Backtracking
Backtracking Algorithm in Python
Last Updated: 23 July 2025
Backtracking is a problem-solving algorithmic technique that involves finding a solution incrementally by trying different options and undoing them if they lead to a dead ...
read more
Backtracking
Picked
DSA
Algorithms-Backtracking
Python-DSA
CSES Solutions - Chessboard and Queens
Last Updated: 23 July 2025
Your task is to place eight queens on a chessboard so that no two queens are attacking each other. As an additional challenge, each square is either free or reserved, and ...
read more
Competitive Programming
Picked
Algorithms-Backtracking
CSES Problems
CSES Solutions - Apple Division
Last Updated: 23 July 2025
There are N apples with known weights given as arr[]. Your task is to divide the apples into two groups so that the difference between the weights of the groups is minimal...
read more
Competitive Programming
Picked
Algorithms-Backtracking
CSES Problems
Determine winner of game by converting two consecutive 1s to 0s
Last Updated: 23 July 2025
Given a binary string S of length N. Two players 'A' and 'B' are playing a game and at each alternate turn, the player converts two consecutive 1s to 0s. The game ends whe...
read more
Strings
DSA
Algorithms-Dynamic Programming
Algorithms-Backtracking
Backtracking Algorithm
Last Updated: 23 July 2025
Backtracking algorithms are like problem-solving strategies that help explore different options to find the best solution. They work by trying out different paths and if o...
read more
Backtracking
DSA
Algorithms-Backtracking
Algorithms-Recursion
Tutorial on Path Problems in a Grid, Maze, or Matrix
Last Updated: 23 July 2025
Path in a Grid or Maze refers to problems that involve navigating through a grid-like structure from the source (starting point) to the destination (endpoint) while avoidi...
read more
Matrix
DSA
BFS
DFS
Algorithms-Dynamic Programming
Algorithms-Backtracking
Maximum and Minimum apples distribution limits
Last Updated: 23 July 2025
Given an integer N representing a number of apples and an array weights[] consisting weight of these apples. Distribute them to K people such that they receive equal-weigh...
read more
Backtracking
DSA
Algorithms-Backtracking
Minimum Distance from Boundary to Target on a 2D Matrix
Last Updated: 02 October 2023
Given a matrix of size (n*m) and a point 'p' (x, y). The matrix is given in the form of 0's and 1's. In one move you can go in any of the four possible directions (up, dow...
read more
Matrix
DSA
BFS
DFS
Algorithms-Backtracking
Print all possible ways to write N as sum of two or more positive integers
Last Updated: 15 July 2025
Given an integer N, the task is to print all the possible ways in which N can be written as the sum of two or more positive integers.Examples:Input: N = 4Output:1 1 1 11 1...
read more
Greedy
Backtracking
Mathematical
Recursion
DSA
Arrays
Algorithms-Backtracking
Algorithms-Recursion
Unique subsequences of length K with given sum
Last Updated: 15 July 2025
Given an array arr[] of N integers and two numbers K and S, the task is to print all the subsequence of length K with the sum S.Examples:Input: N = 5, K = 3, S = 20, arr[]...
read more
DSA
subsequence
Algorithms-Backtracking
Rat in a Maze | Backtracking using Stack
Last Updated: 11 July 2025
Prerequisites - Recursion, Backtracking and Stack Data Structure.A Maze is given as N*M binary matrix of blocks and there is a rat initially at (0, 0) ie. maze[0][0] and t...
read more
DSA
Algorithms-Backtracking
Print all the cycles in an undirected graph
Last Updated: 11 July 2025
Given an undirected graph, print all the vertices that form cycles in it.Undirected GraphInput: In the above diagram, the cycles have been marked with dark green color. Th...
read more
Misc
Graph
DSA
DFS
Algorithms-Backtracking
graph-cycle
Graph Coloring
Introduction to Backtracking
Last Updated: 30 September 2025
Backtracking is a problem-solving algorithmic technique that involves finding a solution incrementally by trying different options and undoing them if they lead to a dead ...
read more
Picked
DSA
Algorithms-Backtracking
Tutorials
DSA Tutorials
Print all the combinations of a string in lexicographical order
Last Updated: 23 November 2021
Given a string str, print of all the combinations of a string in lexicographical order.Examples:Input: str = "ABC"Output:AABABCACACBBBABACBCBCACCACABCBCBAInput: EDOutput:D...
read more
DSA
C-String-Question
Algorithms-Backtracking
Algorithms-Recursion
lexicographic-ordering
1
2