Ask your own question, for FREE!
Computer Science 21 Online
OpenStudy (anonymous):

how to retrieve top 4 elements in a binary tree

OpenStudy (shadowfiend):

Hm. It depends. Do you mean in a certain language/implementation, or do you mean in general what the algorithm would be?

OpenStudy (anonymous):

Top 4 in what way? The lowest? Largest? The four closest to the top?

OpenStudy (anonymous):

recursively... make a function that internally calls itself left right and then ends, the base case being that there are no nodes left and right

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!