二叉排序、查找树:
1、用随机函数生成10个待排序元素;
2、利用二叉查找树输出升序序列;
3、利用同一棵二叉查找树输出降序序列;
4、写出查找的递归函数;
#include<iostream>
#include<ctime>
using namespace std;
typedef int ElemType;
typedef struct BinarySortTreeNode
{
ElemType data;
struct BinarySortTreeNode *lchild, *rchild;
}BinarySortTreeNode,*BinarySortTree;
int random[10]; //random数组用来存储随机数
void GetTenRand() //得到十个随机数
{
srand(signed(time(0)));
for (int i = 0; i < 10; i++