/**注意往链表头插入元素的情况 * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NU...
分类:
编程语言 时间:
2015-07-21 20:17:21
阅读次数:
107
测试环境:vs2010 windows7
逆序分别采用递归调用和链表头插法实现逆序。
具体代码如下:
#include
#include
using namespace std;
class LinkList
{
private:
struct Node
{
struct Node *next;
int value;
};
Node *phead;
void rever...
分类:
编程语言 时间:
2015-07-14 22:48:36
阅读次数:
193
#include "stdio.h"
#include "string.h"
#include "ctype.h"
#include "stdlib.h"
#include "io.h"
#include "math.h"
#include "time.h"
#define OK 1
#define ERROR 0
#define TRUE 1
#define FALSE 0
#define ...
分类:
其他好文 时间:
2015-07-07 19:30:46
阅读次数:
260
、#include "stdio.h"#include "stdlib.h"typedef struct List { int data; //数据域 struct List *next; //指针域} List;void TailCreatList(List *L) //尾插法建立链表{ List...
分类:
其他好文 时间:
2015-07-07 12:37:15
阅读次数:
217
简单的项目开始: ionic start camera-upload blank 添加平台 ionic platform add ios # 需要mac环境
ionic platform add android 添加必要的插件 MacBook:camera-upload jiang$ cat RAEDME.md
# 摄像头插件
ioni...
分类:
Web程序 时间:
2015-07-03 19:24:47
阅读次数:
255
在该双向循环链表中,表头结点first不存元素;当双向循环链表为空时:first->rlink=first->llink=first;以下代码实现了双向循环链表的插入、删除操作;在插入操作中,实现了头插法以及按序插入法。//main.cpp
//----------建立一个双向循环链表-------#include
using namespace std;
class dblis...
分类:
编程语言 时间:
2015-06-29 17:15:36
阅读次数:
210
vim分三种模式,normal,insert,visual。模式间切换:esc : insert 切至normal快捷键切换:i:光标前插入字符I:当前行开头插入字符O:当前行上自动插入一行o:当前行下自动插入一行a:光标后插入字符A:当前行末尾插入字符s:删除当前光标后字符S:删除一行r:用新输入...
分类:
系统相关 时间:
2015-06-18 18:48:50
阅读次数:
299
problem:Reverse a singly linked list.Hint:A linked list can be reversed either iteratively or recursively. Could you implement both?solution:头插法逆转链表/*...
分类:
其他好文 时间:
2015-06-16 21:09:03
阅读次数:
175
废话不多说,直接看代码#include #include #define ElemType inttypedef struct node{ ElemType data; struct node *next;}node,*link;void display(link list);//使用头插法lin....
分类:
其他好文 时间:
2015-06-10 01:07:23
阅读次数:
206