Tag

backtracking

0 views collected around this technical thread.

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.

backtrackingchessboardknight's tour
0 likes · 7 min read
Solve the Knight’s Tour with Python: A Step-by-Step Backtracking Guide
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.

DFANFAThompson algorithm
0 likes · 22 min read
Regular Expressions and Finite Automata: Theory, Performance, and Conversion
Full-Stack Internet Architecture
Full-Stack Internet Architecture
May 20, 2021 · Fundamentals

Understanding Full Permutations and Backtracking in Java

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.

DFSJavaalgorithm
0 likes · 6 min read
Understanding Full Permutations and Backtracking in Java
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.

AlgorithmsBinary TreeData 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.

JavaNFAPerformance
0 likes · 12 min read
Why a Single Regex Can Crash Your Java Service: Understanding NFA Backtracking
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.

JavaNFAPerformance
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.

JavaNFAPerformance
0 likes · 12 min read
Why a Simple Regex Can Crash Your CPU: Understanding NFA Backtracking
High Availability Architecture
High Availability Architecture
Jun 21, 2018 · Fundamentals

Understanding Regex Backtracking and Performance Issues in Java URL Validation

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.

JavaNFAPerformance
0 likes · 12 min read
Understanding Regex Backtracking and Performance Issues in Java URL Validation
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.

JavaNFAPerformance
0 likes · 13 min read
Understanding Catastrophic Backtracking in Java Regular Expressions and How to Fix It
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.

OptimizationSearchalgorithm
0 likes · 6 min read
Branch and Bound Method vs Backtracking: Basic Description and Comparison
Qunar Tech Salon
Qunar Tech Salon
Apr 5, 2015 · Fundamentals

Backtracking Algorithm: Concepts, Core Ideas, General Steps, and Frameworks

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
Backtracking Algorithm: Concepts, Core Ideas, General Steps, and Frameworks