Tagged articles
backtracking
24 articles · Page 1 of 1
This article walks through implementing a complete solution to the classic Knight’s Tour problem on an 8×8 chessboard using Python, detailing the knight’s L-shaped moves, board initialization, move validation, a recursive backtracking algorithm, and how to print the resulting path.
Pathfindingbacktrackingchessboard
0 likes · 7 min read

This article shares practical interview communication advice and demonstrates a Java backtracking solution that enumerates every possible k‑element combination within the range [1, n] using pruning for efficiency.
AlgorithmCombinationInterview Tips
0 likes · 5 min read

This article walks through the LeetCode 77 "Combinations" problem, explaining the backtracking approach, presenting detailed examples, constraints, and providing complete implementations in Java, C++, and Python for generating all k‑element subsets of the range [1, n].
C++JavaLeetCode
0 likes · 6 min read

This article explains LeetCode problem 77, describing how to generate every possible combination of k numbers from the range 1 to n using backtracking, and provides complete Java, C++, and Python implementations along with a brief analysis and constraints.
C++JavaLeetCode
0 likes · 6 min read

The article explains LeetCode 491, requiring all non‑decreasing subsequences of length ≥2 from an integer array, and details a depth‑first search approach that uses a per‑level set to skip duplicates, with complete example implementations in Java, C++, C, and Python.
C++DFSJava
0 likes · 7 min read

The article explains how to use a max‑heap together with backtracking and a greedy strategy in Python to recommend the top three attractions with the highest scores while keeping the total travel distance under 20 km, and discusses the algorithm's steps, example execution, and limitations.
HeapPythonRecommendation System
0 likes · 12 min read

This article compiles a comprehensive set of Python algorithm templates—including syntax shortcuts, knapsack solutions, backtracking, union‑find, topological sorting, monotonic stacks, binary search, dynamic programming, prefix sums, two‑pointer techniques, tree traversals, and graph algorithms—providing clear code snippets and explanations to help developers ace LeetCode interview problems.
AlgorithmsGraphLeetCode
0 likes · 30 min read

This article explains the LeetCode 39 "Combination Sum" problem, illustrates recursion with an apple‑picking analogy, details the backtracking algorithm pattern, and provides a complete, well‑commented Go implementation that handles unlimited reuse of candidates and pruning based on the target sum.
GoLeetCodebacktracking
0 likes · 5 min read

The article shows how greedy versus lazy regex patterns can differ dramatically in speed, explains that regular expressions are compiled into finite automata, walks through converting regexes to NFAs, transforming them into DFAs, minimizing those DFAs, and illustrates how backtracking and catastrophic backtracking arise, urging developers to grasp automata theory for writing efficient, reliable patterns.
DFANFAThompson algorithm
0 likes · 22 min read

Learn how to automate a web-based Sudoku game using Python's Selenium for data extraction, implement an efficient backtracking and bitwise algorithm to solve the puzzle, and programmatically fill the solution back into the browser, achieving performance improvements from 17 seconds to just over 3 seconds.
PythonSudokuautomation
0 likes · 11 min read

This article explains the concept of full permutations, presents a classic interview problem requiring all permutations of a distinct integer array, and walks through a backtracking solution in Java with detailed step‑by‑step analysis and code examples.
AlgorithmDFSJava
0 likes · 6 min read

This comprehensive guide explores core algorithmic strategies for finding optimal solutions—including recursion, greedy methods, divide-and-conquer, dynamic programming, backtracking, and branch-and-bound—explaining their principles, use-cases, and providing concrete Java and C++ code examples to illustrate implementation details.
AlgorithmsDivide and Conquerbacktracking
0 likes · 54 min read

This article compiles a comprehensive list of over 400 algorithm and data‑structure problem solutions—including dynamic programming, backtracking, DFS/BFS, binary‑tree, linked‑list, stack, sorting, searching and classic puzzles—organized by topic and linked to detailed explanations for easy reference.
Algorithmsbacktrackingbinary tree
0 likes · 9 min read

An unexpected CPU spike in a Java service was traced to a complex URL‑validation regex whose NFA backtracking caused catastrophic performance, and the article explains the regex engine’s behavior, identifies the problematic pattern, and shows how to refactor the expression to eliminate excessive backtracking.
CPUJavaNFA
0 likes · 12 min read

This article explains how to enumerate every permutation of an array using a depth‑first search backtracking algorithm, illustrates the process with a tree diagram, compares DFS with BFS, and provides a complete C implementation along with a generic Python template.
AlgorithmC++DFS
0 likes · 7 min read

A Java service suffered near‑100% CPU usage because a URL‑validation regular expression caused catastrophic backtracking, and the article explains the NFA engine behavior, identifies the regex flaws, and shows how to rewrite the pattern with possessive quantifiers to dramatically improve performance.
CPUJavaNFA
0 likes · 12 min read

The article explains how a complex Java regular‑expression used for URL validation triggers catastrophic backtracking, causing near‑100% CPU usage, and demonstrates how to analyze, reproduce, and fix the regex by reducing greedy patterns and adding missing characters.
CPUJavaNFA
0 likes · 11 min read

The article examines a Java URL‑validation regex that caused near‑100% CPU usage, explains how Java's NFA engine and backtracking lead to catastrophic performance, and shows how to rewrite the pattern with possessive quantifiers and proper character classes to eliminate the issue.
JavaNFAbacktracking
0 likes · 12 min read

This article analyzes why a seemingly simple Java regular expression for URL validation caused near‑100% CPU usage, explains NFA backtracking, demonstrates the problem with concrete examples, and provides practical fixes and tools to avoid catastrophic regex performance pitfalls.
NFAURL validationbacktracking
0 likes · 12 min read

During a production incident a Java service’s URL‑validation regex caused near‑100 % CPU due to catastrophic backtracking from a greedy domain pattern, which was fixed by adding missing characters to the final class and converting the domain part to a possessive or atomic quantifier, preventing exponential matching.
JavaNFAbacktracking
0 likes · 13 min read

This article revisits fundamental algorithmic strategies—divide‑and‑conquer, dynamic programming, greedy methods, backtracking, and branch‑and‑bound—detailing their core ideas, applicable problem characteristics, key considerations, procedural steps, and illustrative examples such as merge sort, coin change, Huffman coding, and shortest‑path problems.
AlgorithmsDivide and Conquerbacktracking
0 likes · 7 min read

The article revisits fundamental algorithmic strategies—including divide‑and‑conquer, dynamic programming, greedy methods, backtracking, and branch‑and‑bound—detailing their core ideas, applicable problem characteristics, key considerations, procedural steps, and illustrative examples such as merge sort, coin change, Huffman coding, minimum spanning trees, and shortest‑path problems.
AlgorithmsDivide and Conquerbacktracking
0 likes · 7 min read

The article explains the branch and bound algorithm, comparing it with backtracking, describing its search strategies, general procedure, and key differences such as search order, node handling, and optimal solution finding, while providing a basic overview and illustrative diagram.
Algorithmbacktrackingbranch-and-bound
0 likes · 6 min read

This article explains the backtracking algorithm as an enumeration‑like depth‑first search technique, outlines its fundamental concepts, basic ideas, typical problem‑solving steps, and provides both non‑recursive and recursive pseudo‑code frameworks for implementation.
Algorithmbacktrackingdepth-first-search
0 likes · 4 min read
