文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > 线性表代码
侵权投诉

线性表代码

#include<iostream.h>

#include<stdlib.h>

typedef int ElemType;

struct LNode{

ElemType data;

LNode *next;

};

//Output the list

void TraverseList(LNode *p)

{

cout<<"The list is:";

while(p!=NULL)

{

cout<<p->data<<" ";

p=p->next;

}

};

//Output the lenth of the list

void LenthList(LNode *p)

{

int number=0;

cout<<"Lenth of list:";

while(p!=NULL)

{

number++;

p=p->next;

}

cout<<number<<endl;

};

//Find the postion of the number

void FindList(LNode *p)

{

int m ,i=0,j=0;

cout<<"Enter the number you find:";

cin>>m;

while(p!=NULL)

{

i++;

if(p->data==m)

{

j++;

第1页

你可能喜欢

热门文档

相关文档

  • 线性表代码

    构造一个新的线性表 { L.elem=(Elemtype *)malloc(LIST_INIT_SIZE*sizeof(Elemtype)); if(!L.elem) exit(OVERFLOW); L.length=0;//空表长度为0 L....

  • 线性表源代码

    线性表源代码_计算机软件及应用_IT/计算机_专业资料 暂无评价0人阅读0次下载举报文档 线性表源代码_计算机软件及应用_IT/计算机_专业资料。#include<stdio.h>...

  • 线性表基本代码

    线性表基本代码_计算机软件及应用_IT/计算机_专业资料。关于c语言的数据结构#include <stdio.h> #include <stdlib.h> #include #define OK 1 #define ERROR...

  • 线性表源代码

    线性表代码线性表代码隐藏>> #include<string.h> #include<malloc.h> #include<stdlib.h> #include<stdio.h> #define maxsize 100 typedef struct Student ...

  • 线性表代码实现

    线性表代码实现_计算机软件及应用_IT/计算机_专业资料。数据结构 C语言#include <stdio.h> #include <string.h> #include <stdlib.h> //宏定义 #define ...

  • 线性表代码示例

    线性表代码示例 隐藏>> #include "stdio.h" #include "malloc.h" //---(1)预定义常量及类型--- #define OK 1 #define ERROR 0 #define OVERFLOW -2 ...

  • 线性表的基本操作员代码

    线性表的基本操作员代码_IT/计算机_专业资料。集合了线性表的素有基本操作#include<stdio.h> #include<malloc.h> #define MaxSize 50 typedef char ElemType; ...

  • 1线性表的定义源代码

    线性表的定义源代码线性表的定义源代码隐藏>> #include<stdio.h> #include<malloc.h> #include<conio.h> #define ERROR 0 #define OK 1 #define EQUAL 1...

  • 数据结构 线性表 顺序表 源代码C

    数据结构 线性表 顺序表 源代码C_IT/计算机_专业资料。数据结构 线性表 顺序表 源代码C,实现了新建顺序表,顺序表的插入,删除,查找。合并等功能...

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email