Skip to main content

PriorityQueue.is_empty

Checks if the binary heap is empty

Usage

is_empty()

Returns:
      Boolean
            True if the heap is empty

Example

from jellybeans.structures import PriorityQueue as PQpq = PQ(comparator=lambda x,y: x<=y) # Min heapprint(pq.is_empty()) # Truepq.insert(10)pq.insert(5)pq.insert(15)pq.insert(25)print(pq.is_empty()) # False