随笔分类 -  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 ... 阅读全文
posted @ 2015-06-27 17:23 jianchao-li 阅读(501) 评论(0) 推荐(0) 编辑
摘要:Graph is an important data structure and has many important applications. Moreover, grach traversal is key to many graph algorithms.There are two syst... 阅读全文
posted @ 2015-06-26 23:09 jianchao-li 阅读(854) 评论(0) 推荐(0) 编辑
摘要: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... 阅读全文
posted @ 2015-06-19 15:25 jianchao-li 阅读(262) 评论(0) 推荐(0) 编辑
摘要: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... 阅读全文
posted @ 2015-06-15 11:46 jianchao-li 阅读(265) 评论(0) 推荐(0) 编辑
摘要: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... 阅读全文
posted @ 2015-06-13 23:10 jianchao-li 阅读(483) 评论(0) 推荐(0) 编辑
摘要: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... 阅读全文
posted @ 2015-06-13 22:36 jianchao-li 阅读(333) 评论(0) 推荐(0) 编辑
摘要:Radix sort is another linear time sorting algorithm. It sorts (using another sorting subroutine) the numbers from their least significant digits to mo... 阅读全文
posted @ 2015-06-09 20:48 jianchao-li 阅读(289) 评论(0) 推荐(0) 编辑
摘要: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... 阅读全文
posted @ 2015-06-09 15:44 jianchao-li 阅读(264) 评论(0) 推荐(0) 编辑
摘要:Recently I systematicall review some sorting algorithms, including insertion sort, bubble sort, merge sort and quick sort. I then implement them in C+... 阅读全文
posted @ 2015-06-04 22:45 jianchao-li 阅读(362) 评论(0) 推荐(0) 编辑
摘要:Recently I reviewed the classic heapsort algorithm and implement it according to contents in Introduction to Algorithms (3rd edition). The heap data s... 阅读全文
posted @ 2015-06-04 22:33 jianchao-li 阅读(256) 评论(0) 推荐(0) 编辑