数据结构C语言版 循环链表表示和实现(国外英文)

数据结构C语言版 循环链表表示和实现(国外英文资料)

Data structure, C language, circular list representation and implementation of.Txt

*

Data structure, C language, circular list representation and Implementation

P35

Compile environment: Dev-C++ 4.9.9.2

Date: February 10, 2011

* /

#include

#include

#include

Typedef int ElemType;

/ / single stranded linear table storage structure

Typedef struct LNode

{

ElemType data;

Struct LNode *next;

}LNode, *LinkList;

To distinguish what is / / the first node ((*L) ->next), the tail node (*L), and the first node

/ / point (*L) ->next->next, the establishment of circular linked list tail pointer (end to end, the head node

/ / and the tail node is the same, they have no data domain.

/ / constructing an empty circular list L

Int InitList_CL (LinkList *L)

{

Have / head node and the L, pointing to the head

*L = (LinkList) malloc (sizeof (struct, LNode));

If (... *L)

Exit (0);

/ / pointer field toward the head node, so as to form a circular, empty table loop, *L table tail

(*L) ->next = *L;

Return 1;

}

The destruction of the circular list / / L

Int DestroyList_CL (LinkList *L)

{

LinkList q,

P = ->next (*L); / / P refers to the head node

While (P! = *L) / / not to the table for table tail tail, *L

{

Q = p->next;

Free (P);

P = q;

}

Free (*L);

*L = NULL;

Return 1;

}

/ / reset L to the empty table

Int ClearList_CL (LinkList *L)

{

LinkList, P, q;

*L= (*L ->next); / / L points to the first node

P= (*L ->next); / / P refers to the first node

While (P! =*L) / / not to list.

{

Q=p->next;

Free (P);

P=q;

}

->next=*L (*L); / / the first node pointer domain refers to itself

Return 1;

}

/ / if L is empty table, it returns 1, otherwise it returns 0

Int ListEmpty_CL (LinkList L)

{

If (L->next==L) / / empty

Return 1;

Else

Return 0;

}

/ / returns the number of elements in the L data

Int ListLength_CL (LinkList L)

{

Int i=0;

LinkList p=L->next; / / P refers to the head node

While (P! =L) / / not to list.

{

I++;

P=p->next;

}

Return i;

}

When / / th

C语言中链表的英文名字,数据结构C语言版 循环链表表示和实现(国外英文).doc相关推荐

  1. c语言中存贮班级学生的变量,C语言----变量教案.docx

    C语言----变量教案 课 题 2.2 常量和变量----变量 课型 理实一体化 授课班级 高二计算机(升学班) 课时 2 教学目标 复习巩固C语言中常量的应用: 掌握C语言中变量的命名规则及应用. ...

  2. c语言中计算一个字母的序数,C语言编程 输入一串字符统计英文字母的个数

    C语言编程:输入一行字符,至少50个,统计其中英文字母,数字,其他字母个数 楼上那个不能统计空格个数,我这个可以#include#includeintmain(){intcnt_c=0,cnt_n=0 ...

  3. 在c语言中 使用变量的要求,关于C语言中变量的探讨

    摘 要: 在所有的计算机高级语言中,都存在着变量这样一个重要的概念.变量是计算机高级语言程序的重要成分之一.与其他语言中的变量相比,C语言中的变量所包含的内容更为丰富,包括变量的定义.数据类型.变量数 ...

  4. c语言中单词的作用与形式,C语言基础教程:单词的用法与规则

    在C语言中,单词是由若干个有序的字符组成的,单词的集合称为词汇.C语言的单词有如下几种:标识符.关键字.运算符.分隔符.常量.字符串和注释符. 下面对上述7种单词的词法规则逐一详述,有些单词,例如,关 ...

  5. c语言中负数的读取和存储,C语言中负数的存储方式

    详细介绍负数的文章: https://blog.csdn.net/daiyutage/article/details/8575248 1.以char类型举例,其取值范围是 -128 ~ 127,即-2 ...

  6. python语言描述兰伯特pdf_数据结构PYTHON语言描述 [美] Kenneth A. Lambert 兰伯特

    第1章 Python编程基础 1 1.1 基本程序要素 1 1.1.1 程序和模块 1 1.1.2 Python程序示例:猜数字 1 1.1.3 编辑.编译并运行 Python程序 2 1.1.4 程 ...

  7. c语言 数据结构面试题及答案,数据结构(C语言)【经典题库】含答案

    数据结构(C语言)[经典题库]含答案 <数据结构与算法>复习题 选择题 1.在数据结构中,从逻辑上可以把数据结构分为 C . A.动态结构和静态结构 B.紧凑结构和非紧凑结构 C.线性结构 ...

  8. 数据结构c语言程序题,严蔚敏《数据结构(c语言版)习题集》(包括基础部分).doc...

    严蔚敏<数据结构(c语言版)习题集>(包括基础部分).doc 线性表第1章绪论11简述下列术语数据,数据元素.数据对象.数据结构.存储结构.数据类型和抽象数据类型.解数据是对客观事物的符号 ...

  9. c语言中 允许函数重载么,简述C++语言支持函数重载问题介绍

    对于C++语言作为一种欲与C兼容的语言,C++语言保留了一部分过程式语言和特点,foo_int_int这样的名字包含了函数名.函数参数数量及类型信息,C++语言就是靠这种机制来实现函数重载的. 因而它 ...

最新文章

  1. html实现上下层效果图,Css布局系列-上下两栏应用场景_html/css_WEB-ITnose
  2. python简介怎么写-python简历模板范文
  3. Visual Studio 2013 Web开发新特性
  4. python 父类构造函数,python 对于子类构造函数重写父类构造函数的了解
  5. 线上日志集中化可视化管理:ELK
  6. 腾讯邓君:《王者荣耀》翻过的同步技术相关的三座大山
  7. TCL_事务控制语言
  8. js 匿名函数_javascript:函数的使用
  9. 【PyCharm】10个省时间的 PyCharm 技巧
  10. Oracle分页总汇
  11. linux shell sort多字段排序
  12. Squid 配置文件详解
  13. DirectX截图黑屏的解决办法
  14. VB.net绘制tan函数图像
  15. Python 判断素数(循环结构)
  16. [原创]网上一位叫啊松得网友提供,本人搜集!!
  17. setAttribute(Qt::WA_DeleteOnClose) 导致程序崩溃问题
  18. DenseTNT翻译
  19. 删除打印机重新安装驱动
  20. android判断通知铃声是否静音模式

热门文章

  1. Jetson Xavier(Ubuntu18.04)安装固态硬盘并挂载到/home区下
  2. htmlvideoelement js操作
  3. MARKET1501的学习,跟着苏同学的博客学习
  4. gentoo 安装opencv
  5. ffmpeg3.3新版本AVStream的封装流参数由codec替换codecpar
  6. Numpy自定义dtype的一个使用误区
  7. java开发环境选择
  8. Day01 你如何保持健康
  9. supervisor 管理进程
  10. 对linux文件权限的理解,理解linux文件权限2