什么是链表,这种数据结构是由一组Node组成的,这群Node一起表示了一个序列。链表是最普通,最简单的数据结构,它是实现其他数据结构如stack, queue等的基础。
链表比起数组来,更易于插入,删除。
Node可以定义如下:
typedef int element_type;
typedef struct node *node_ptr;
struct node {
el...
分类:
其他好文 时间:
2015-04-29 23:27:55
阅读次数:
192
Seqlish.h#include<stdio.h>
#include<string.h>
#defineMAXSIZE100//定义线性表的最大长度
typedefstruct//定义顺序表结构
{
DATAListData[MAXSIZE+1];//保存顺序表的数组
intListLen; // 顺序表已存节点的数量
}SeqListType;
voidSeqListInit(SeqListType*..
分类:
其他好文 时间:
2015-04-28 02:08:22
阅读次数:
120
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
structstu_node{
charnum[15];
intscore;
structstu_node*next;
};
structstu_node*stu_create()
{
structstu_node*head,*newN,*tail;
charnum[15];
intscore;
printf("请输入学生的学号和..
分类:
其他好文 时间:
2015-04-28 00:09:46
阅读次数:
262
2.2.3 线性链表(线性表的链式存储结构)线性链表:
用一组任意的存储单元来存储线性表中的数据元素,并用指针域实现逻辑上相邻的关系...
分类:
其他好文 时间:
2015-04-25 12:20:45
阅读次数:
123
//带头节点
#include
using namespace std;
typedef int ElemType;
typedef struct Node
{
ElemType data;
struct Node *next;
}LNode,*LinkList;
void InitList(LinkList &L);
void CreateCyList(LinkList ...
分类:
其他好文 时间:
2015-04-22 20:41:56
阅读次数:
111
先说背景,本人编程技巧极渣,其余各种万金油半桶水,毕业工作半年后,反而退三年。满打满算,大概是因为进了XJM的群里,从2015年3月12日左右才开始接触python。入门书籍:《笨方法学python》,《python核心编程》第一个星期:用python写数据结构,链表,栈,队列结果被我拖了差不多十天...
分类:
编程语言 时间:
2015-04-17 13:36:12
阅读次数:
176
不懂的先看一下这个百度文库资料http://wenku.baidu.com/link?url=sBTDm0r0or_eLyZPHnsGs5mlnKYKtzuX9FveJ-nguoQcFPM-ZjWauNFP0P2cvh7Qx-UZToPFHMzoGT0mB92rza5LkHT78FMzPIUaKqW...
分类:
编程语言 时间:
2015-04-01 12:55:58
阅读次数:
220
带头节点单链表
数据结构定义
ListNode.h
#ifndef LISTNODE_H
#define LISTNODE_H
template class ListNode
{
private:
T data;
ListNode *next;
public:
ListNode();
ListNode(T value);
int Getdata();
ListNode* Ge...
分类:
其他好文 时间:
2015-03-31 14:51:11
阅读次数:
201
目录目录
简介
单向链表
双向链表
环形链表
Linux内核中的链表实现
offsetof
container_of
container_of 第一部分
container_of 第二部分
链表初始化
向链表中增加一个节点
删除节点
移动节点
判断链表是否为空
遍历链表
Demo测试
tlisth
mlistc
执行结果简介最近在学习Android Binder驱动程序实现的时候,发现里面的数据结构...
分类:
系统相关 时间:
2015-03-17 23:49:03
阅读次数:
662
双向链表 只是 比 单链表 多了 一个 指向 前驱的 指针,在插入 和 删除 元素的 时候 得多处理一些。其余 没什么 区别。
而循环链表 的 尾指针 不再 指向 NULL,而是 指向 头指针,这样 既可以循环遍历,又节省 存储空间 。
每种链表 都有 好处,至于 如何 取舍,得看需求。
下面 奉上 双向链表的实现代码:
// DoubleLinkList.cpp : 定义控制台应...
分类:
其他好文 时间:
2015-02-15 16:40:14
阅读次数:
166