摘要: 摘选自这位大神的博客 方法一: 结构体在内存中分配一块连续的内存,但结构体内的变量并不一定是连续存放的,这涉及到内存对齐。原则1 数据成员对齐规则:结构(struct或联合union)的数据成员,第一个数据成员放在offset为0的地方,以后每个数据成员存储的起始位置要从该成员大小的整数倍开始(比如 阅读全文
posted @ 2018-11-18 22:02 Ruohua3kou 阅读(1372) 评论(0) 推荐(0) 编辑
摘要: ``` Position BinarySearch(List L, ElementType X) { int beg = 1; int end = L Last; while (beg Data[mid] == X) return mid; else if (L Data[mid] 阅读全文
posted @ 2018-11-18 18:41 Ruohua3kou 阅读(747) 评论(0) 推荐(0) 编辑
摘要: 6.8 二叉树高度 6 9 二叉树的遍历 阅读全文
posted @ 2018-11-18 13:04 Ruohua3kou 阅读(723) 评论(0) 推荐(0) 编辑
摘要: ``` //如果堆栈已满,Push函数必须输出“Stack Full”并且返回false;如果某堆栈是空的,则Pop函数必须输出“Stack Tag Empty”(其中Tag是该堆栈的编号),并且返回ERROR。 Stack CreateStack(int MaxSize) { Stack sta = (Stack)malloc(sizeof(struct SNode)); sta... 阅读全文
posted @ 2018-11-18 11:21 Ruohua3kou 阅读(433) 评论(0) 推荐(0) 编辑