how insert items binary tree in java in order? want use random values , sort them smallest largest insert them binary tree in order:
1 2 3 4 5 6 7 8 9
when 'in order' need clarify, mean in sorted order or mean insertion order, etc.
there lots of resources available on inserting binary trees or difference between types of binary trees, or how print binary tree diagram, suspect duplicate.
what different example? having '1' root node means must not have rebalancing tree since both '2' , '3' larger value root node. insert rule seems inconsistent since if '1' first node inserted other values cascade right branch of tree unless use different rule root @ other levels pain code.
Comments
Post a Comment