# Complexity of Interval Heap Operations

Data Structure AlgorithmsAnalysis of AlgorithmsAlgorithms

Best Seller

89 Lectures 11.5 hours

#### Practical Data Science using Python

22 Lectures 6 hours

#### Data Science and Data Analysis with Python

50 Lectures 3.5 hours

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.
Updated on 03-Jan-2020 05:27:43