![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c语言
YuzhiboTudou
这个作者很懒,什么都没留下…
展开
-
树的高度的计算
思路如下图所示: 采用递归的思路;黑色的是进入递归时变量的值,红色时返回时值;核心代码如下:typedef struct node BTree;typedef BTree* pBTree;struct node{ pBTree Father; pBTree LeftChild; pBTree RightChild;};int Heigh(pBTree T) /原创 2017-08-20 19:32:09 · 2520 阅读 · 0 评论 -
二分查找(C语言实现)
二分查找(C语言实现):#include <stdio.h>typedef int ElementType;typedef ElementType* pElement;ElementType Binarysearch(pElement Arr, ElementType x, int Left, int Right){ int Mid = (Right + Left) / 2;原创 2017-08-20 19:39:31 · 808 阅读 · 0 评论 -
已知两个链表head1 和head2 各自有序,请把它们合并成一个链表依然有序。
题目:已知两个链表head1 和head2 各自有序,请把它们合并成一个链表依然有序。(保留所有结点,即便大小相同) 1.循环方法:核心代码:pNode Combine(pNode p,pNode node1, pNode node2) //node1 node2是有序的链表的头;将两个有序的链表合并,并保持有序状态{ pNode p1 = node1; pNode p原创 2017-08-22 18:27:00 · 2146 阅读 · 0 评论 -
树的遍历问题
题目:若某二叉树的前序遍历访问顺序是abdgcefh,中序遍历访问顺序是dgbaechf,则其后序遍历的结点访问顺序是__; 解决方法:原创 2017-08-22 18:31:03 · 241 阅读 · 0 评论