码迷,mamicode.com
首页 >  
搜索关键字:linklist    ( 405个结果
链表应用举例
例一:求表长 设一个移动工作指针p和一个计数器j,初始时p=L->next,J=0,若p非空,则计数器加1,并将指针下移一个位置,直到达链表尾,算法描述如下:int LinkListLen(LinkList L) { //求带头结点的单链表L的长度 LNode *p int j=0; p=L->next;//p指向第一个结点 while(p){j++;p=p->ne...
分类:其他好文   时间:2015-08-02 20:09:50    阅读次数:191
Collection接口
Collection !--List:元素是有序的,元素可以重复,因为该集合体系有索引。 !--ArrayList:底层的数据结构使用的是数组结构。 特点:查询速度很快,但是增删很慢。 线程不同步,效率高 !--LinkList:底层使用的是链表数据结构。 ...
分类:其他好文   时间:2015-08-02 10:14:28    阅读次数:161
arraylist和linkList区别
ForLinkedListget(int index)is O(n)add(E element)is O(1)add(int index, E element)is O(n)remove(int index)is O(n)Iterator.remove()is O(1) ListIterator.a...
分类:其他好文   时间:2015-08-01 21:46:56    阅读次数:182
_DataStructure_C_Impl:循环单链表
//CycList:循环单链表 #include #include typedef int DataType; typedef struct Node{ DataType data; struct Node *next; }ListNode,*LinkList; //创建一个不带头结点的循环单链表 LinkList CreateCycList(int n){ DataType e; Li...
分类:其他好文   时间:2015-08-01 01:11:17    阅读次数:172
语言中结构体变量和结构体类型的定义
1.结构体类型定义定义方式1:Typedef struct LNode { int data; // 数据域 struct LNode *next; // 指针域} *LinkList;定义方式2:struct LNode { int data; // 数据域 struct LNode *next;...
分类:编程语言   时间:2015-07-30 10:57:01    阅读次数:210
C++链表,增删改查
// //  main.c //  homework_linkList // //  Created by jiumiao on 15/7/23. //  Copyright (c) 2015年 jiumiao. All rights reserved. // #include #include typedef struct _NPC{     char n...
分类:编程语言   时间:2015-07-24 18:17:45    阅读次数:116
集合框架
集合框架是为表示和操作集合而规定的一种统一的标准的体系结构。任何集合框架都包含三大块内容:对外的接口、接口的实现和对集合运算的算法。集合有ArrayList、Vector、hashmap、linklist、treemap、hashset等多种实现。为了屏蔽实现差异,java提供了一个Collecti...
分类:其他好文   时间:2015-07-23 21:36:40    阅读次数:120
用java实现一个链表
链表是一种物理存储单元上非连续、非顺序的存储结构,数据节点的逻辑顺序是通过链表中的指针连接次序实现的。链表----Java实现: 1 package com.mianshi.easy; 2 3 public class LinkList { 4 5 //节点类是内部类 6 ...
分类:编程语言   时间:2015-07-23 13:28:42    阅读次数:130
设立尾指针的单循环链表的表示和实现
设有尾指针的单循环链表的12个基本操作void InitList(LinkList &L){ L = (LinkList)malloc(sizeof(LNode));//产生头结点,并使L指向此头结点 if (!L)exit(OVERFLOW); L->next = L;//头结点的指针域指向头结点 }void ClearList(LinkList &L){ Link...
分类:其他好文   时间:2015-07-20 21:40:22    阅读次数:220
部分链表操作总结
部分链表操作总结#include #include using namespace std;// definition of Node struct Node { int val; Node *next; Node(int x) : val(x), next(NULL){} };// create a linklist with n...
分类:其他好文   时间:2015-07-20 19:35:54    阅读次数:69
405条   上一页 1 ... 24 25 26 27 28 ... 41 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!