I want to draw binary tree in reverse order. For example I've 4 elements.I like to put them in leaf node then in next iteration I combine two of them until I've one root node. every parent have Identity which is used for creation of new parent. nodes contains any objects. Orders is not mandatory. and two nodes can be combined in next iteration and in last level these nodes can be in any order
Example is like this:
This is just a example for understanding. Solution can be in any language or any algorithm for explanation.