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 |
Can we clone singleton class in java?
What is variable explain with example?
What is the purpose of encapsulation?
how to handle exceptions in ejb?
What are the types of methodology?
What do you mean by default constructor in java?
Explain about abstract classes in java?
What is a file pointer?
Explain features of interfaces in java?
What code optimizations techniques you follow in general practice?
2 Answers Accenture, TCS, Wipro,
Functionality of JVM?
What is the use of java?