文件名称:shunxu
介绍说明--下载内容均来自于网络,请自行研究使用
//顺序表的建立、查找、插入与删除
#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#define ListSize 100 //表最大长度
//结构定义
typedef struct SeqList
{
int node[ListSize] //存放表结点
int length //当前表长度
} SeqList
//插入元素
insertList(SeqList *list, int e)
{
int i=list->length-1 //先将i指定为最后一项
if(i>=ListSize-1) //表已经达到最大长度ListSize
{
printf("表已满,不能增加新的项!\n")
-//The order of table creation, search, insert and delete# Include <stdio.h># Include <malloc.h># Include <stdlib.h># Define ListSize 100// maximum length of table// structure definition typedef struct SeqList (int node [ListSize]// store table Node int length// length of the current table) SeqList// insert elements insertList (SeqList* list, int e) (int i = list-> length-1// first will i designated as the last if (i> = ListSize-1)// table has reached the maximum length ListSize (printf ( table is full, can not add new items! )
#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#define ListSize 100 //表最大长度
//结构定义
typedef struct SeqList
{
int node[ListSize] //存放表结点
int length //当前表长度
} SeqList
//插入元素
insertList(SeqList *list, int e)
{
int i=list->length-1 //先将i指定为最后一项
if(i>=ListSize-1) //表已经达到最大长度ListSize
{
printf("表已满,不能增加新的项!\n")
-//The order of table creation, search, insert and delete# Include <stdio.h># Include <malloc.h># Include <stdlib.h># Define ListSize 100// maximum length of table// structure definition typedef struct SeqList (int node [ListSize]// store table Node int length// length of the current table) SeqList// insert elements insertList (SeqList* list, int e) (int i = list-> length-1// first will i designated as the last if (i> = ListSize-1)// table has reached the maximum length ListSize (printf ( table is full, can not add new items! )
(系统自动生成,下载前可以参看下载内容)
下载文件列表
shunxu.c