摘要: #include <iostream> int MidSearch(int *A,int *B,int n) { //分别表示序列A和序列B的首位数,末位数和中位数,s是start简写,d是end简写 int s1=0, d1 = n - 1, m1, s2 = 0, d2 = n - 1, m2; 阅读全文
posted @ 2023-04-12 21:12 ha_1007 阅读(58) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<stdlib.h> typedef int KeyType; typedef struct BSTNode{ KeyType key; struct BSTNode *lchild,*rchild; }BSTNode,*BiTree; //非递归 阅读全文
posted @ 2023-04-11 15:12 ha_1007 阅读(52) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<stdlib.h> typedef int KeyType; typedef struct BSTNode{ KeyType key; struct BSTNode *lchild,*rchild; }BSTNode,*BiTree; //非递归 阅读全文
posted @ 2023-04-11 14:21 ha_1007 阅读(47) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<stdlib.h> #include<time.h> typedef int ElemType; typedef struct { ElemType* elem; //整型指针 int TableLen; //存储动态数组里边元素的个数 }SST 阅读全文
posted @ 2023-04-10 21:28 ha_1007 阅读(48) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<stdlib.h> #include<time.h> typedef int ElemType; typedef struct { ElemType *elem; //整型指针,申请的堆空间的起始地址存入elem int TableLen; // 阅读全文
posted @ 2023-04-10 20:11 ha_1007 阅读(54) 评论(0) 推荐(0)
摘要: Description 读取字符串abcdefghij,然后层次建树建立一颗二叉树,然后中序遍历输出 hdibjeafcg,后序遍历输出 hidjebfgca,层序遍历输出abcdefghij,注意不要输出汉字 Input abcdefghij Output 中序遍历输出hdibjeafcg,后序遍 阅读全文
posted @ 2023-04-10 17:07 ha_1007 阅读(58) 评论(0) 推荐(0)
摘要: Description 读取字符串abcdefghij,然后层次建树建立一颗二叉树,然后前序遍历输出abdhiejcfg,注意不要打印前序遍历几个汉字 Input abcdefghij Output abdhiejcfg Sample Input 1 abcdefghij Sample Output 阅读全文
posted @ 2023-04-10 16:54 ha_1007 阅读(38) 评论(0) 推荐(0)
摘要: function.h // // Created by 93757 on 2023/3/21. // #ifndef INC_1_TREE_FUNCTION_H #define INC_1_TREE_FUNCTION_H #include <stdio.h> #include <stdlib.h> 阅读全文
posted @ 2023-04-09 17:52 ha_1007 阅读(43) 评论(0) 推荐(0)
摘要: function.h // // Created by 93757 on 2023/3/21. // #ifndef INC_1_TREE_FUNCTION_H #define INC_1_TREE_FUNCTION_H #include <stdio.h> #include <stdlib.h> 阅读全文
posted @ 2023-04-09 16:45 ha_1007 阅读(52) 评论(0) 推荐(0)
摘要: #include <iostream> #include <stdlib.h> typedef int elemtype; typedef struct link_node{ elemtype data; struct link_node *next; }link_node; typedef str 阅读全文
posted @ 2023-04-09 15:46 ha_1007 阅读(48) 评论(0) 推荐(0)