b*********n 发帖数: 1258 | 1 1) a binary tree and 2) a binary graph?
Thank you. | s********y 发帖数: 3811 | 2 1) array ?
【在 b*********n 的大作中提到】 : 1) a binary tree and 2) a binary graph? : Thank you.
| k*k 发帖数: 49 | 3 1) binary tree
serialize:
pre-order unambiguous form:
(r (r_left) (r_right (r_right_l) ()))
a recursive implementation is much easier than iterative version.
de-serialize:
scan from left to right, use stack for temporary recording, when ')' is
encountered, pops to the previous '(' and generate node accordingly.
2) binary graph
what is the definition of a binary graph? |
|