• Post Reply Bookmark Topic Watch Topic
  • New Topic

Finding maximum element in min heap ?  RSS feed

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can you find the maximum element in min heap ?
 
Sheriff
Posts: 21136
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is this "min heap"? Is it from here? If so, you'll need some recursion. The maximum of a node is the maximum of its left node, its right node and its own value. The maximum of the left and right nodes is where recursion comes into play.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!