题目:有700个结点的完全二叉树,有多少叶结点? 解答:首先700个结点的完全二叉树的深度是: h=[log2N]+1=[log2700]+1=10层 所以,前面9层是满二叉树,其节点数是: //根据二叉树性质5,深度为k的满二叉树,
数据结构——栈的基本操作 /* 对栈实现初始化,插入栈顶元素,删除栈顶元素,遍历栈,清空栈等基本操作 */ 1 #include <stdio.h> 2 #include <malloc.h> 3 #include <stdlib.h> 4 5 #define true 1
1 /* 2 循环队列的基本操作,初始化,入队,遍历,出队等操作 3 */ 4 #include <stdio.h> 5 #include <malloc.h> 6 7 #define true 1 8 #define false 0 9 10 typedef struct Queue 11 { 12 int *pBase
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号