The bliss C++ API
Public Member Functions | List of all members
bliss::Heap Class Reference

A min-heap of unsigned integers. More...

#include <heap.hh>

Public Member Functions

bool is_empty () const
 
void clear ()
 
void insert (const unsigned int e)
 
unsigned int smallest () const
 
unsigned int remove ()
 
size_t size () const
 

Detailed Description

A min-heap of unsigned integers.

Member Function Documentation

◆ clear()

void bliss::Heap::clear ( )
inline

Remove all the elements in the heap. Time complexity is O(1).

◆ insert()

void bliss::Heap::insert ( const unsigned int  e)
inline

Insert the element e in the heap. Time complexity is O(log(N)), where N is the number of elements currently in the heap.

◆ is_empty()

bool bliss::Heap::is_empty ( ) const
inline

Is the heap empty? Time complexity is O(1).

◆ remove()

unsigned int bliss::Heap::remove ( )
inline

Remove and return the smallest element in the heap. Time complexity is O(log(N)), where N is the number of elements currently in the heap.

◆ size()

size_t bliss::Heap::size ( ) const
inline

Get the number of elements in the heap.

◆ smallest()

unsigned int bliss::Heap::smallest ( ) const
inline

Return the smallest element in the heap. Time complexity is O(1).


The documentation for this class was generated from the following file: