I need to build a binary tree from a preorder bitstring (which is piped into standard input in a stream) and I was wondering if my understanding of this was correct.
If I had a preorder bitstring of 11110001000 (where 1 indicates an internal node and 0 indicates an external node), would that result in a binary tree like this?
1 / \ 1 0 / \ 1 1 / \ / \ 1 00 0 / \ 0 0
After building the binary tree from the preorder bitstring (which is given through the input), I also need to find the height, path length, and whether the binary tree is complete or not. However I'm having trouble progressing to the point where I'm able to do this because I don't know how to get started on implementing the preorder bitstring -> binary tree conversion in Java. Could anyone please give hints on how I'd get started on building a binary tree from the preorder bitstring?
EDIT: Thank you both.