
算法/数据结构
文章平均质量分 80
nullpointer
这个作者很懒,什么都没留下…
展开
-
交换排序(exchange sorts)算法大串讲
转自:http://dsqiu.iteye.com/blog/1707060本文内容框架:§1 冒泡排序(Bubble Sort)及其改进§2 鸡尾酒(Cocktail Sort)排序 §3 奇偶(Odd-even Sort)排序§4 快速(Quick Sort)排序及其改进§5 梳(Comb Sort)排序 §转载 2012-10-29 16:32:06 · 832 阅读 · 0 评论 -
二叉树的遍历(递归 and 非递归)
转自http://www.cnblogs.com/dolphin0520/archive/2011/08/25/2153720.html 二叉树是一种非常重要的数据结构,很多其它数据结构都是基于二叉树的基础演变而来的。对于二叉树,有前序、中序以及后序三种遍历方法。因为树的定义本身就是递归定义,因此采用递归的方法去实现树的三种遍历不仅容易理解而且代码很简洁。而对于树的遍历若采用非递归的转载 2013-04-26 17:35:01 · 768 阅读 · 0 评论 -
面试题记1
希望各位看客们能积极提供答案1)125874和它的两倍251748,包含着同样的数字,只是顺序不同。找出最小的正整数x,使得2x,3x,4x,5x,和6x都包含有相同的数字。2)求100!各位数之和3)是用从1到9所有数字,将其任意的连接起来,使之组成十进制数,会得到不同的集合。{2,5,47,89,631}就是比较有趣的集合,它的所有数都属于质数,请问满足1-9都是用且只是用一次,而原创 2013-05-20 22:20:27 · 1375 阅读 · 2 评论 -
Sunday algorithm
Ideahttp://www.iti.fh-flensburg.de/lang/algorithmen/pattern/sundayen.htmThe Boyer-Moore-algorithm uses for its bad-character heuristics the text symbol that has caused a mismatch. The Horspool转载 2013-12-15 23:36:35 · 743 阅读 · 0 评论 -
Knuth-Morris-Pratt algorithm
Knuth-Morris-Pratt algorithm IdeaAfter a shift of the pattern, the naive algorithm has forgotten all information about previously matched symbols. So it is possible that it re-compar转载 2013-12-15 23:28:32 · 1052 阅读 · 0 评论 -
Horspool algorithm
Ideahttp://www.iti.fh-flensburg.de/lang/algorithmen/pattern/horsen.htmThe Boyer-Moore algorithm uses two heuristics in order to determine the shift distance of the pattern in case of a mismatc转载 2013-12-15 23:35:37 · 1464 阅读 · 0 评论 -
Boyer-Moore algorithm
Ideahttp://www.iti.fh-flensburg.de/lang/algorithmen/pattern/bmen.htmThe algorithm of Boyer and Moore [BM 77] compares the pattern with the text from right to left. If the text symbol that is c转载 2013-12-15 23:34:29 · 1166 阅读 · 0 评论 -
simple skiplist implementation in c
#ifndef MY_SKIP_LIST#define MY_SKIP_LIST#include #include #include typedef int DataType;#define MAX_LEVEL 8struct DataNode;typedef struct NodeLevel{ struct DataNode * forward; u原创 2015-01-13 09:00:44 · 866 阅读 · 0 评论