开发者

Storing a input into a tree

I want to store the following input in a tree such that a number (lets call it x) at level i has two children at level i+1, one is just below x and the other one is one position right to the node just below x. For example, consider the following input:开发者_如何学JAVA

1

2 1

3 1 3

4 2 1 1

Here the number 1 at level 2 (level starts from 0) has two children 2 and 1.

I want to store it in a tree. How to do this?


as your question is not very specific:
you might want to read the wiki article about binary search trees an then update your question in a more precise way?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜