随笔分类 -  C/C++

各类链表
指针-->(纯指针)
摘要:1 #include <iostream> 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <string.h> 5 6 using namespace std; 7 8 int main(){ 9 char p[20]="you are a student!";10 int *a = (int *)p;11 int **b = &a;12 char *c;13 c = p;14 cout<<"*b-> "<< 阅读全文

posted @ 2012-11-02 10:49 凌峰布衣 阅读(209) 评论(0) 推荐(0) 编辑

单向链表->单向循环链表
摘要:1 #include <stdio.h> 2 #include <iostream> 3 #include <stdlib.h> 4 5 using namespace std; 6 7 struct Person{ 8 int age; 9 struct Person *next; 10 }; 11 Person *CrtHeadNode(){ 12 Person *head ,*tmp; 13 head = tmp = NULL; 14 Person *p=NULL; 15 int n; 16 cout<<"N... 阅读全文

posted @ 2012-11-01 17:52 凌峰布衣 阅读(333) 评论(0) 推荐(0) 编辑

双向链表->非循环
摘要:1 (1)定义双向链表的基本结构 2 typedef struct _DOUBLE_LINK_NODE 3 { 4 int data; 5 struct _DOUBLE_LINK_NODE* prev; 6 struct _DOUBLE_LINK_NODE* next; 7 }DOUBLE_LINK_NODE; 8 9 (2)创建双向链表节点 10 [cpp] view plaincopy 11 12 DOUBLE_LINK_NODE* create_doub... 阅读全文

posted @ 2012-11-01 16:37 凌峰布衣 阅读(629) 评论(0) 推荐(0) 编辑

单向链表->创建节点
摘要:#include <stdio.h>#include <iostream>#include <stdlib.h>using namespace std;struct Person{ int age; struct Person *next;};Person *CrtTailNode(){ Person *head ,*tmp; head = tmp = NULL; int n; cout<<"Node Number:"<<endl; cin>>n; for(int i = 0;i<n;i++){ 阅读全文

posted @ 2012-11-01 09:21 凌峰布衣 阅读(372) 评论(0) 推荐(0) 编辑

导航