链表
huohaifeng
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
如何把链表逆序
#include using namespace std; typedef struct node{ int data; struct node *next; }Node; //怎么样把一个链表掉个顺序 node * convert( Node * head ) { if( head == NULL ) { printf( "empty list!\n"); return NUL原创 2013-09-12 19:40:03 · 272 阅读 · 0 评论 -
链表相交、有环无环、交点等
struct int_List_Node{ int value; struct int_List_Node *next; }; //判断两个无环链表是否相交 bool is_crossed( struct int_List_Node * head1 , struct int_List_Node * head2 ) { if( ( head1 == NULL ) || ( head2 ==原创 2013-09-13 13:59:33 · 242 阅读 · 0 评论 -
输出单链表倒数第k个结点
//输出单链表倒数第k个结点 struct int_List_Node{ int value; struct int_List_Node *next; }; int count_back_k( const struct int_List_Node * L , const int k ) { struct int_List_Node *p = L; struct int_List_Nod原创 2013-09-14 18:43:42 · 290 阅读 · 0 评论
分享