Effective implementation of algorithms (Master Thesis)
Effective and error-free implementation of algorithms
heap Namespace Reference

Functions

template<typename T >
left (T x)
template<typename T >
right (T x)
template<typename T >
parent (T x)
template<typename T >
bool isLeftChild (T x)
template<typename T >
bool isRightChild (T x)
template<typename T >
sibling (T x)
template<typename T >
nextPowerOfTwo (T x)

Function Documentation

template<typename T >
bool heap::isLeftChild ( x) [inline]
Returns:
true if this is left child
template<typename T >
bool heap::isRightChild ( x) [inline]
Returns:
true if this is right child
template<typename T >
T heap::left ( x) [inline]
Parameters:
xnode_position
Returns:
position of node corresponding to left child
template<typename T >
T heap::nextPowerOfTwo ( x)

Find smallest power of two that is at least x. Example: 2->2, 3->4, 4->4, 5->8

Returns:
next power of two
Exceptions:
overflow_error
template<typename T >
T heap::parent ( x) [inline]
Parameters:
xnode_position
Returns:
position of the parent node
template<typename T >
T heap::right ( x) [inline]
Parameters:
xnode_position
Returns:
position of node corresponding to right child
template<typename T >
T heap::sibling ( x) [inline]
Returns:
position of sibling of this node
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines