AlgoPlus v0.1.0
Loading...
Searching...
No Matches
min_heap< T > Class Template Reference

min heap class More...

#include <min_heap.h>

Public Member Functions

 min_heap (size_t max_size) noexcept
 Construct a new min heap object.
 
parent (T i)
 parent function
 
_left (T i)
 __left function
 
_right (T i)
 __right function
 
_min ()
 __min function Returns the minimum with heapify
 
min ()
 min function. Returns the minimum of the heap(the first element)
 
void decrease_key (T i, T key)
 
void insert (T key)
 insert function
 
void remove (T key)
 remove function
 
void heapify (T i)
 heapify function
 

Detailed Description

template<typename T>
class min_heap< T >

min heap class

Constructor & Destructor Documentation

◆ min_heap()

template<typename T>
min_heap< T >::min_heap ( size_t max_size)
inlineexplicitnoexcept

Construct a new min heap object.

Parameters
max_size: maximum size of the heap

Member Function Documentation

◆ _left()

template<typename T>
T min_heap< T >::_left ( T i)
inline

__left function

Parameters
ithe element we want to find the left

◆ _right()

template<typename T>
T min_heap< T >::_right ( T i)
inline

__right function

Parameters
ithe element we want to find the right

◆ heapify()

template<typename T>
void min_heap< T >::heapify ( T i)
inline

heapify function

Parameters
ithe element we want to heapify from

◆ insert()

template<typename T>
void min_heap< T >::insert ( T key)
inline

insert function

Parameters
keythe key to be inserted

◆ parent()

template<typename T>
T min_heap< T >::parent ( T i)
inline

parent function

Parameters
ithe element we want to find the parent

◆ remove()

template<typename T>
void min_heap< T >::remove ( T key)
inline

remove function

Parameters
keythe key to be removed

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