【数据结构】线性表之顺序表的创建
来源:互联网 发布:防辐射眼镜 知乎 编辑:程序博客网 时间:2024/06/08 15:54
1.C语言中是没有引用的
2.int InitList_Sq (SqList*
Sqlist.h
#include <stdio.h>#include <conio.h>#include <stdlib.h>#define OK 1#define ERROR 0#define OVERFLOW 0#define LIST_INIT_SIZE 100#define LISTINCREMENT 10typedef struct{ int *elem; int length; int listsize;} SqList;int InitList_Sq (SqList* L){ (*L).elem=(int *)malloc(LIST_INIT_SIZE*sizeof(int)); if(!(*L).elem) exit(OVERFLOW); (*L).length=0; (*L).listsize=LIST_INIT_SIZE; return OK;}
Sqlist.cpp
// Sqlist.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "Sqlist.h"int CreateList_Sq ( SqList *L ){ int i; printf("Input the datas:"); for(i=0;i<(*L).length;i++) scanf("%d",&((*L).elem[i])); return OK;}int main(){ int i,n; SqList L; InitList_Sq(&L); printf("Input the length of the list L:"); scanf("%d",&n); L.length=n; CreateList_Sq(&L); printf("Output the datas:"); for(i=0;i<L.length;i++) printf("%d ",L.elem[i]); printf("\n"); return 0;}
0 0
- 【数据结构】线性表之顺序表的创建
- 数据结构之线性表的顺序存储
- 数据结构之顺序线性表
- 数据结构之顺序线性表
- 数据结构之创建线性表
- 进击的数据结构一之线性表的顺序结构
- 数据结构—线性表之顺序表的操作
- 数据结构之---c语言实现线性表的顺序表
- 数据结构之线性表中顺序表的基本操作
- [数据结构]线性表之顺序表的类模板实现
- 数据结构之线性表---顺序表的逆置
- 数据结构之线性表(顺序表)的基本操作
- 数据结构之:线性表的顺序表示和实现
- 数据结构之线性表的顺序表示和实现
- 数据结构笔记之线性表的顺序存储结构
- 数据结构之线性表的顺序存储结构
- Python 数据结构 之 线性表 的顺序存储结构
- 数据结构之线性表——栈的顺序存储
- 有关direct show 编译问题汇总(二)
- 动态table的给添加或者删除行
- Shell for Telnet
- #128 Hash Function
- 如何正确地写出单例模式
- 【数据结构】线性表之顺序表的创建
- Java设计模式透析之 —— 模板方法(Template Method)
- Shell for SSH
- First Unique Character in a String
- JS创建对象的几种方式
- JAVA生成随机码程序
- C#在一台客户端进行了某个操作以后如何让其他不同的客户端如何实现相同的操作(二)
- 51nod 1284 2 3 5 7的倍数
- Universal-Image-Loader源码阅读(16)-memory/impl/FuzzyKeyMemoryCache