Question: Given a heap, write code to output the elements in a left, right, left, right . . . . order starting from the root.
Given a heap, write code to output the elements in a left, right, left, right . . . . order starting from the root. For example, your program should print 77, 45, 10, and 31 for the following tree. The code should be generic, and should work with any size heap. 7 33 51 31 10 26 77 23 17 44 26
Step by Step Solution
3.38 Rating (154 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
