Blog
In-depth articles on AI agents, LLM engineering, servers, Python and software development.
Bubble Sort is a classic introductory sorting algorithm. Its core idea is similar to bubbles rising: by repeatedly comparing adjacent elements and swapping out-of-order pairs, smaller elements gradual
Radix sort is a non-comparative integer sorting algorithm. Its core idea is to distribute elements into buckets and collect them by each digit (from the least significant to the most significant). The
Bucket sort is a non-comparison-based sorting algorithm based on the divide-and-conquer principle. It achieves overall order by dividing data into buckets, sorting elements within each bucket, and the
Counting sort is an efficient non-comparison sorting algorithm suitable for integers with a small value range. Its time complexity is O(n + k), where n is the number of elements and k is the data rang
Merge sort is based on the divide and conquer algorithm, with three core steps: divide (split the array into left and right subarrays until single elements), recursively sort (recursively sort each su
Heap Sort is an efficient sorting algorithm that leverages the heap data structure, with a stable time complexity of O(n log n) and a space complexity of O(1), making it suitable for sorting large-sca
Selection sort is a simple and intuitive sorting algorithm. Its core idea is to repeatedly select the smallest (or largest) element from the unsorted elements and place it at the end of the sorted por
Shell Sort is an improved version of Insertion Sort, which enhances efficiency by "coarsely sorting" and then "finely sorting" through grouping to reduce element intervals. The core involves selecting
This paper introduces the insertion sort algorithm, whose core idea is to insert elements one by one into a sorted subarray, similar to the ordered insertion when organizing playing cards. The basic a
Quick Sort is based on the "divide and conquer" principle, with the core being selecting a pivot value to partition the array and recursively sorting the subarrays. The basic idea is: select a pivot v