随笔分类 - Algorithms
Implementation of some classic algorithms.
摘要:Topological sort is an important application of DFS in directed acyclic graphs (DAG). For each edge (u, v) from node u to node v in the graph, u must ...
阅读全文
摘要:Graph is an important data structure and has many important applications. Moreover, grach traversal is key to many graph algorithms.There are two syst...
阅读全文
摘要:KMP is a classic and yet notoriously hard-to-understand algorithm. However, I think the following two links give nice explanations. You may refer to t...
阅读全文
摘要:The Longest Increasing Subsequence (LIS) problem requires us to find a subsequence t of a given sequence s, such that t satisfies two requirements:Ele...
阅读全文
摘要:The Longest Common Subsequence (LCS) problem is as follows:Given two sequences s andt, find the length of the longest sequence r, which is a subsequen...
阅读全文
摘要:The Longest Common Substring (LCS) problem is as follows:Given two strings s and t, find the length of the longest string r, which is a substring of b...
阅读全文
摘要:Radix sort is another linear time sorting algorithm. It sorts (using another sorting subroutine) the numbers from their least significant digits to mo...
阅读全文
摘要:Counting sort is a linear time sorting algorithm. It is used when all the numbers fall in a fixed range. Then it counts the appearances of each number...
阅读全文
摘要:Recently I systematicall review some sorting algorithms, including insertion sort, bubble sort, merge sort and quick sort. I then implement them in C+...
阅读全文
摘要:Recently I reviewed the classic heapsort algorithm and implement it according to contents in Introduction to Algorithms (3rd edition). The heap data s...
阅读全文