Click to See Complete Forum and Search --> : iterative postorder growing of trees, unknown size of tree


chickenandfries
January 26th, 2008, 11:34 PM
Given an input of a string, how do i put its characters in a binary tree in iterative postorder? The length of the string is one less than a power of 2 (e.g. 0, 1, 3, 7, 15..), so the resulting tree would be a "full binary tree". The number of nodes in the tree should be the length of the string, so there should be no "empty nodes". I'm using C. I've done everything i can. Thanks.

CMPITG
January 27th, 2008, 12:02 PM
I think the heap data structure (using array) should be suitable to use. Linked list is good, too.