Blog
In-depth articles on AI agents, LLM engineering, servers, Python and software development.
A trie (prefix tree) is a data structure for handling string prefix problems. Its core is to save space and improve search efficiency by utilizing common prefixes. Each node contains a character, up t
### Parentheses Matching Problem: The "Ultra-Simple" Application of Stacks This article introduces a method to solve the parentheses matching problem using stacks (with the Last-In-First-Out proper
Quick sort is based on the divide and conquer method, with the core being the selection of a pivot and partition. The choice of pivot affects efficiency: selecting the leftmost or rightmost element ca
Merge sort is based on the "divide and conquer" principle, with core steps including decomposition, recursion, and merging. It first recursively splits an array into subarrays of length 1, then merges
A Binary Search Tree (BST) is an efficient data structure designed to solve the problem of "quickly locating targets" in daily data retrieval. It is a special type of binary tree where each node satis
A singly linked list consists of nodes with a data field and a pointer field (next), starting from a head node, with the tail node's next being None. Reversing a linked list is used in scenarios such
Hash tables map keys to array positions using hash functions, but when different keys map to the same position, a hash collision occurs. The core reasons are either the number of keys far exceeding th
BFS is a classic tree traversal method that accesses nodes in a "breadth-first" (level order) manner, with its core implementation relying on a queue (FIFO). The steps are as follows: initialize the q
A tree consists of nodes and edges, where each node (except the root) has exactly one parent and can have multiple children. Depth-First Search (DFS) is a traversal method that "goes deep into one pat
A hash function is a "translator" that converts input of arbitrary length into a fixed-length hash value, which serves as the "ID number" of the data. Its core characteristics include: fixed length (e