- 博客(3)
- 收藏
- 关注
转载 Finding a Loop in a Singly Linked List
MotivationA singly linked list is a common data structure familiar to all computer scientists. A singly linked list is made of nodes where each node has a pointer to the next node (or null to end th
2006-11-16 14:56:00 1783
转载 微软面试技术题
1、反转一个链表。循环算法。 List reverse(List l) { if(!l) return l; list cur = l.next; list pre = l; list tmp; pre.next = null; while ( cur ) { tmp = cur; cur = cur.next; tmp.next = pre pre = tmp; } return tmp; }
2006-11-16 14:44:00 1682
原创 [数据结构]KMP算法实现
#includestdio.h>#includestdlib.h>#define MAX 255void get_next(const char* T,int* next) // 算法4.7{ int i=0,j=-1; next[0]=-1; while (istrlen(T)) { if(j==-1 || T[i]== T[j]) {
2006-11-15 12:59:00 2523
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人