I have been studying Binary Trees for two days! The path to acm allows me to experience the great efforts I have made. I don't need to talk much about it. Check the code I found on the Internet:
The meaning of this question is very clear. I will show you how to traverse in order, search for In-order, and then search for In-order. But the Code makes me unable to find anything.
Http://acm.hdu.edu.cn/showproblem.php? Pid = 1, 1710
# Include <stdio. h> <. h> build (n, * a, * B, ** p = (n <=) (a [] = * ++ x = p-+-x -, a + x +, B + x +, c +-] = [(~ Scanf (, & a [], B [], c [(I =; I <n; I ++, & (I =; I <n; I ++, & (I =; I <n-; I ++, c [n-
This is a code of the struct pointer!
# Include <stdio. h> <stdlib. h> a [], B [node * lchild, ** m =-> lchild =-> rchild = Creat (I, j, k, t, Tree p) -> data = (m = k; m <= t; m ++ (a [I] = (m = k) p-> lchild = +, I + (m-k), k, m-, (p-> lchild); (m = t) p-> rchild = + (m-k) +, j, m +, t, (p-> rchild); (p! =-> (P-> data! = (Flag =, p-> =, p-> (scanf (, & n )! = (I =; I <= n; I ++, & (I =; I <= n; I ++, & =, n,
Maybe you will understand it later!