搜索资源列表
TreeTest2
- 给定一棵有n个结点的二叉树,结点的编号为0~n-1。请你编写程序输出二叉树的前序遍历序列。 Input 输入的第一行是一个正整数t(1 < t < 20),表示有t组测试用例。 对于每组测试用例,第一行是一个整数n(0 < n < 20),表示二叉树结点个数。第二行是一个数r(0≤r≤n-1),二叉树根结点的编号。后面有n-1行,表示二叉树n-1条边的信息。每行三个数a,b,c,三个数间由空格隔开,其中0≤a,b≤n-1且a≠b, c为0或1。a表示边的起点,
BST3_array
- In computer science, a binary tree is a tree data structure in which each node has at most two children, which are referred to as the left child and the right child. A recursive definition using just set theory notions is that a (non-empty) binary tr