Skip to content

All data structures has in Data Structure Book ! Cool!

Notifications You must be signed in to change notification settings

Album1993/DataStructure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Data Structure

implement all simple data structure


Linear List

sequence list

  • init
  • clear
  • destory
  • check if the list is empty
  • get the length of the list
  • get the element in index
  • get the first element's index which meet the comparison condition
  • prior element
  • next element
  • insert
  • delete
  • iterate the list in certain rule

sequence union (Linear union)

  • union

sort two arrays into one array in descending order (MergeSqList)

  • MergeSqList_1(use insert function)
  • MergeSqList_2(use pointer address)

SinglyLinkedList (SinglyLinkedList)

  • init
  • clear
  • destory
  • check if the list is empty
  • get the length of the list
  • get the element in index
  • get the first element's index which meet the comparison condition
  • prior element
  • next element
  • insert
  • delete
  • iterate the list in certain rule
  • head interpolation to create list
  • tail inserting to create list

sort two linkLists into one

  • mergeList

StaticLinkedList

  • provide total storage
  • get the storage the list needs
  • free one element
  • init the list
  • empty the list
  • destory
  • check empty
  • get the length of the list
  • get the element in index
  • get the first element's index which meet the comparison condition
  • prior
  • next
  • insert
  • delete
  • iterate the list

###(stack);

Sequence stack

  • InitList_Sq(SqStack *S);
  • DestoryStock_Sq(SqStack *S);
  • ClearStack_Sq(SqStack *S);
  • StackEmpty_Sq(SqStack S);
  • StackLength_Sq(SqStack S);
  • GetTop_Sq(SqStack s,SElemType_Sq *e);
  • Push_sq (SqStack *s,SElemType_Sq e);
  • Pop_Sq(SqStack *s,SElemType_Sq *e);
  • StackTraverse_Sq(SqStack s,void(Visit)(SElemType_Sq));

useage of stack ,

#####Decimal to octal

  • conversionNum(e); #####LineEdit
  • LineEdit(e);

#####Maze

  • typedef int MazeType;
  • void InitMaze(MazeType maze[][N],Postype *start,Postype *end);
  • void PaintMaze(MazeType maze[][N]);
  • void ShowMaze(MazeType maze[][N]);
  • Status EqualPosType(Postype a,Postype b);
  • Status Pass(Postype seat,MazeType maze[][N]);
  • void FootPrint(Postype seat,MazeType maze[][N]);
  • void SetSElemType(SElemType_Sq *e, int ord,Postype seat, int di);
  • Postype NextPos(Postype seat, int di);
  • Status IsCross(Postype seat);
  • void MarkPrint(Postype seat,MazeType maze[][N]);

数据结构 c实现


实现所有基本数据结构


###链表:(Linear List); ####顺序列表

  • 初始化
  • 清空
  • 销毁
  • 判断是否是空列
  • 列长
  • 获取某个位置的数
  • 根据条件取值(第一个满足的值)
  • 前驱
  • 后继
  • 插入
  • 删除
  • 遍历

链表合并 (Linear union)

  • 合并

链表有序排列 (MergeSqList)

  • MergeSqList_1(使用插入方法)
  • MergeSqList_2(使用指针)

单链表链式存储 (SinglyLinkedList)

  • 初始化
  • 清空
  • 销毁
  • 判断是否是空列
  • 列长
  • 获取某个位置的数
  • 根据条件取值(第一个满足的值)
  • 前驱
  • 后继
  • 插入
  • 删除
  • 遍历
  • 头插法建立单链表
  • 尾插法建立单链表

归并链式存储

  • 归并

静态链表

  • 申请总的空间
  • 申请某个链表的空间
  • 释放某个节点
  • 初始化静态链表
  • 置空
  • 销毁
  • 判空
  • 求长
  • 查询
  • 定位
  • 前驱
  • 后继
  • 插入
  • 删除
  • 遍历

###栈:(stack);

普通栈

  • InitList_Sq(SqStack *S);
  • DestoryStock_Sq(SqStack *S);
  • ClearStack_Sq(SqStack *S);
  • StackEmpty_Sq(SqStack S);
  • StackLength_Sq(SqStack S);
  • GetTop_Sq(SqStack s,SElemType_Sq *e);
  • Push_sq (SqStack *s,SElemType_Sq e);
  • Pop_Sq(SqStack *s,SElemType_Sq *e);
  • StackTraverse_Sq(SqStack s,void(Visit)(SElemType_Sq));

栈的使用

#####十进制转换为八进制

  • conversionNum(e); #####行编辑程序
  • LineEdit(e); #####迷宫
  • typedef int MazeType;
  • void InitMaze(MazeType maze[][N],Postype *start,Postype *end);
  • void PaintMaze(MazeType maze[][N]);
  • void ShowMaze(MazeType maze[][N]);
  • Status EqualPosType(Postype a,Postype b);
  • Status Pass(Postype seat,MazeType maze[][N]);
  • void FootPrint(Postype seat,MazeType maze[][N]);
  • void SetSElemType(SElemType_Sq *e, int ord,Postype seat, int di);
  • Postype NextPos(Postype seat, int di);
  • Status IsCross(Postype seat);
  • void MarkPrint(Postype seat,MazeType maze[][N]);

About

All data structures has in Data Structure Book ! Cool!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published