- 博客(5)
- 收藏
- 关注
原创 Longest Repeated Substring
I wrote the a program to get the Longest Repeated Substring of a string. I think the way I used should be Dynamic Programming. The basic steps are:1) First find all Repeated Substrings with only one c
2011-06-29 17:53:00 1571
原创 堆:左倾树
堆是一种树型数据结构,一般组织成二叉树的形式。堆具有这样的属性,对于每一个节点,父节点上的元素大于子孙节点。具体实现可以用链表,也可以用数组。优先队列(Priority Queue)可以用堆来实现。下面介绍一种左倾树(Leftist Tree)的实现方式,参考Algorithms:a functional programming approach. 左倾树首先是堆,具有堆的属性。左倾树的每
2011-06-26 23:13:00 1384
原创 tail recursive
Followed 3 functions written in Haskell language, which are fac1, fac2 and fac3. They are all for calculating factorial. The performance of them are different. fac1 10000 takes (0.97 secs, 10469
2011-06-19 20:16:00 1025
原创 Get middle element of a linked-list
Suppose therere odd number of elements in a linked-list, how to get the middle element in it? I find a clever way to achieve this on internet. Two pointers point to the linked-list. One is slow point
2011-06-19 01:52:00 766
原创 How to compare linked-lists?
We say two linked-lists are equal if they have the same number of elements, and the elements themselves are the same. Furthermore elements order are not significant. If compared linked-lists are
2011-06-09 17:20:00 630
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人