列表的基本操作: 1.定义一个列表 cast=["xiaoming","xiaohua","xiaomei","xiaobai"] 2.使用len()BIF得出列表中的数据项,访问列表数据 1) print(len(cast)) 2)print(cast[1]) 3.在列表末尾添加一个数据项 cas ...
分类:
其他好文 时间:
2017-07-10 12:04:04
阅读次数:
163
#pragma once #ifndef _CLIST_H_ #define _CLIST_H_ #include <iostream> #include <assert.h> using namespace std; template<class Type> class List; typedef ...
分类:
编程语言 时间:
2017-07-08 11:20:24
阅读次数:
264
哈希表中,关键值通过哈希函数映射到数组上,查找时通过关键值直接访问数组。哈希表的关键问题在于哈希函数的构造和解决冲突的方法。 下面采用最简单的线性探测展示一下哈希表的基本操作: ...
分类:
其他好文 时间:
2017-07-06 23:56:02
阅读次数:
208
#include #include #include typedef struct stu{ int d; struct stu *l; }st; void xj(st *h)//生成单链表 { st *l; l=h; int m; scanf("%d",&m); h=(st *)malloc(si... ...
分类:
其他好文 时间:
2017-06-21 17:32:43
阅读次数:
179
<span style="font-size:18px;"><strong>#pragma once #include <iostream> using namespace std; typedef enum { FALSE, TRUE }Status; template<class Type> c ...
分类:
编程语言 时间:
2017-06-11 13:42:05
阅读次数:
230
链表也是一种线性表,但与线性表不同的是,链表的物理存储结构是一堆地址任意的存储单元。也就是说,链表的数据在内存中的物理位置可能相互邻接,也有可能不邻接。 单链表的基本操作如下: ...
分类:
其他好文 时间:
2017-06-10 22:28:47
阅读次数:
253
package com.baorant; public class JavaDemo { public static void main(String[] args) { LinkList linkList = new LinkList(); linkList.addFirstNode(20); l... ...
分类:
编程语言 时间:
2017-06-01 22:06:52
阅读次数:
171
1.创建列表 2.在一个列表中加入一个新的列表 3.选择某几项(有三种方法) ...
分类:
其他好文 时间:
2017-05-28 11:49:42
阅读次数:
106
1.带表头的单向链表 (1)不带表头的单向链表在实现插入和删除时必须区分头结点和其它节点的处理。 (2)使用带表头的单向链表的优点:不用考虑头结点的单独处理。 表头节点:数据域没有值,指针域指向单向链表中数据域含值的第一个结点。 2.代表头的单向链表的基本操作 #include <stdio.h> ...
分类:
其他好文 时间:
2017-05-25 18:20:29
阅读次数:
247