Define max and min heap, also the search time of heap.



Define max and min heap, also the search time of heap...

Answer / Megha Agarwal

"Max Heap and Min Heap are types of binary heaps used in data structures.
1. Max Heap: A Max Heap is a complete binary tree with the property that the parent node is greater than or equal to its child nodes. The maximum value is always at the root.
2. Min Heap: A Min Heap is a complete binary tree with the property that the parent node is less than or equal to its child nodes. The minimum value is always at the root.
3. Search time for both max and min heaps in the average case is O(log n)."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Can we clone singleton class in java?

1 Answers  


What is variable explain with example?

1 Answers  


What is the purpose of encapsulation?

1 Answers  


how to handle exceptions in ejb?

1 Answers   Satyam,


What are the types of methodology?

1 Answers  


What do you mean by default constructor in java?

1 Answers  


Explain about abstract classes in java?

1 Answers  


What is a file pointer?

1 Answers  


Explain features of interfaces in java?

1 Answers  


What code optimizations techniques you follow in general practice?

2 Answers   Accenture, TCS, Wipro,


Functionality of JVM?

7 Answers   Infosys,


What is the use of java?

1 Answers  


Categories