Tagged articles
22 articles
Page 1 of 1
Code Mala Tang
Code Mala Tang
Apr 21, 2025 · Fundamentals

Solve the Knight’s Tour with Python: A Step-by-Step Backtracking Guide

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.

BacktrackingPathfindingchessboard
0 likes · 7 min read
Solve the Knight’s Tour with Python: A Step-by-Step Backtracking Guide
Su San Talks Tech
Su San Talks Tech
Mar 10, 2025 · Fundamentals

Generate All k-Number Combinations from 1 to n (LeetCode 77)

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.

BacktrackingC++LeetCode
0 likes · 6 min read
Generate All k-Number Combinations from 1 to n (LeetCode 77)
Alibaba Cloud Developer
Alibaba Cloud Developer
Apr 11, 2024 · Fundamentals

Master LeetCode Algorithms: Essential Python Templates for Interviews

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.

AlgorithmsBacktrackingData Structures
0 likes · 30 min read
Master LeetCode Algorithms: Essential Python Templates for Interviews
NetEase Cloud Music Tech Team
NetEase Cloud Music Tech Team
Feb 23, 2023 · Fundamentals

Regular Expressions and Finite Automata: Theory, Performance, and Conversion

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.

BacktrackingDFANFA
0 likes · 22 min read
Regular Expressions and Finite Automata: Theory, Performance, and Conversion
Intelligent Backend & Architecture
Intelligent Backend & Architecture
May 19, 2021 · Fundamentals

Master Optimal Algorithms: Recursion, Greedy, Divide-Conquer, DP & Backtracking

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.

AlgorithmsBacktrackingRecursion
0 likes · 54 min read
Master Optimal Algorithms: Recursion, Greedy, Divide-Conquer, DP & Backtracking
DataFunTalk
DataFunTalk
Dec 25, 2020 · Fundamentals

Curated Collection of Algorithm and Data Structure Problems with Solution Articles

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.

AlgorithmsBacktrackingData Structures
0 likes · 9 min read
Curated Collection of Algorithm and Data Structure Problems with Solution Articles
Efficient Ops
Efficient Ops
Jan 22, 2020 · Fundamentals

Why a Single Regex Can Crash Your Java Service: Understanding NFA Backtracking

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.

BacktrackingCPUNFA
0 likes · 12 min read
Why a Single Regex Can Crash Your Java Service: Understanding NFA Backtracking
JavaEdge
JavaEdge
Jan 7, 2020 · Fundamentals

How to Generate All Permutations with Backtracking: A Step‑by‑Step Guide

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.

BacktrackingDFSRecursion
0 likes · 7 min read
How to Generate All Permutations with Backtracking: A Step‑by‑Step Guide
IT Architects Alliance
IT Architects Alliance
Nov 25, 2019 · Fundamentals

Why a Complex URL Regex Can Max Out Java CPU and How to Fix It

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.

BacktrackingCPUNFA
0 likes · 12 min read
Why a Complex URL Regex Can Max Out Java CPU and How to Fix It
Java Captain
Java Captain
May 20, 2019 · Fundamentals

Understanding Java Regex Backtracking and Its Impact on CPU Usage

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.

BacktrackingCPUNFA
0 likes · 11 min read
Understanding Java Regex Backtracking and Its Impact on CPU Usage
Efficient Ops
Efficient Ops
Jun 26, 2018 · Fundamentals

Why a Simple Regex Can Crash Your CPU: Understanding NFA Backtracking

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.

BacktrackingNFAjava
0 likes · 12 min read
Why a Simple Regex Can Crash Your CPU: Understanding NFA Backtracking
Tencent Cloud Developer
Tencent Cloud Developer
Jun 19, 2018 · Backend Development

Understanding Catastrophic Backtracking in Java Regular Expressions and How to Fix It

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.

BacktrackingNFAjava
0 likes · 13 min read
Understanding Catastrophic Backtracking in Java Regular Expressions and How to Fix It
ITFLY8 Architecture Home
ITFLY8 Architecture Home
Aug 24, 2017 · Fundamentals

Classic Algorithms: Divide‑Conquer, DP, Greedy, Backtracking, Branch‑and‑Bound

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.

AlgorithmsBacktrackingbranch-and-bound
0 likes · 7 min read
Classic Algorithms: Divide‑Conquer, DP, Greedy, Backtracking, Branch‑and‑Bound
ITFLY8 Architecture Home
ITFLY8 Architecture Home
Dec 17, 2016 · Fundamentals

Understanding Classic Algorithms: Divide‑and‑Conquer, DP, Greedy, Backtracking

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.

AlgorithmsBacktrackingbranch-and-bound
0 likes · 7 min read
Understanding Classic Algorithms: Divide‑and‑Conquer, DP, Greedy, Backtracking
Qunar Tech Salon
Qunar Tech Salon
Apr 6, 2015 · Fundamentals

Branch and Bound Method vs Backtracking: Basic Description and Comparison

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.

BacktrackingSearchalgorithm
0 likes · 6 min read
Branch and Bound Method vs Backtracking: Basic Description and Comparison