- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Complexity of Interval Heap Operations
A double-ended priority queue(DEPQ) or interval heap features the following operations −
isEmpty()
This function performs to check if DEPQ is empty and returns true if empty.
size()
This function performs to return the total number of elements present in the DEPQ.
getMin()
This function performs to return the element having lowest priority.
getMax()
This function performs to return the element having maximum priority.
put(z)
This function performs to insert the element z in the DEPQ.
removeMin()
This function performs to remove an element with smallest priority and returns this element.
removeMax()
This function performs to remove an element with highest priority and returns this element.
- The operations isEmpty(), size(), getMin(), and getMax() consume O(1) time each;
- put(z), removeMin(), and removeMax() consume O(log n) each;
- Initializing an n element interval heap takes O(n) time.
Advertisements