Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::BinHeap< Key, Compare > Struct Template Reference

Node heap without virtual destructor. More...

#include <tpl_binHeap.H>

Inheritance diagram for Aleph::BinHeap< Key, Compare >:
[legend]
Collaboration diagram for Aleph::BinHeap< Key, Compare >:
[legend]

Public Types

using Node = BinHeapNode< Key >
 El tipo de nodo del heap.
 
- Public Types inherited from Aleph::GenBinHeap< NodeType, Key, Compare >
using Node = NodeType< Key >
 

Additional Inherited Members

- Public Member Functions inherited from Aleph::GenBinHeap< NodeType, Key, Compare >
Compare & key_comp () noexcept
 
Compare & get_compare () noexcept
 
void swap (GenBinHeap &h) noexcept
 
NodegetRoot () noexcept
 
NodegetRoot () const noexcept
 
template<class Operation >
bool preorder_traverse (Operation op) const
 
template<class Operation >
void for_each_in_preorder (Operation &operation) const
 
template<class Operation >
void for_each_in_preorder (Operation &&operation=Operation()) const
 
template<class Operation >
void for_each_in_inorder (Operation &operation) const
 
template<class Operation >
void for_each_in_inorder (Operation &&operation=Operation()) const
 
template<class Op >
bool level_traverse (Op operation=Op()) const
 
 GenBinHeap (Compare __cmp=Compare()) noexcept
 
virtual ~GenBinHeap () noexcept
 
Nodeinsert (Node *p) noexcept
 Inserta un nodo en un heap.
 
NodegetMin_ne () noexcept
 
NodegetMin ()
 Elimina del heap el nodo de menor prioridad.
 
NodegetMax ()
 
void update (Node *p) noexcept
 Actualiza prioridad de un nodo contenido en el heap.
 
Noderemove (Node *node)
 Elimina del heap el nodo node.
 
void remove_all_and_delete () noexcept
 Borra todos los nodos del heap, invoca a los destructores de los nodos eliminados y libera toda la memoria.
 
Nodetop ()
 Retorna el nodo con menor prioridad según el criterio de comparación especificado en la declaración.
 
Nodetop () const
 
const size_tsize () const noexcept
 
bool is_empty () const noexcept
 
bool verify_heap () const
 
- Protected Member Functions inherited from Aleph::GenBinHeap< NodeType, Key, Compare >
virtual bool verify_heap (Node *p) const
 
- Static Protected Member Functions inherited from Aleph::GenBinHeap< NodeType, Key, Compare >
static Nodeadvance_left (Node *p) noexcept
 
static Nodeadvance_right (Node *p) noexcept
 
- Protected Attributes inherited from Aleph::GenBinHeap< NodeType, Key, Compare >
Compare cmp
 

Detailed Description

template<class Key, typename Compare = Aleph::less<Key>>
struct Aleph::BinHeap< Key, Compare >

Node heap without virtual destructor.

The BinHeap class instruments a node heap. This team doesn't is implemented by array, but with a binary tree. This provides the great advantage of being highly dynamic. The memory used is therefore proportional to the amount of nodes of the HEAP.

Parameters
Keythe key that each node keeps.
Comparethe criterion of comparison between the keys of the Nodes; by default is the relationship "less than".
See also
BinHeapVtl DynBinHeap

Definition at line 1003 of file tpl_binHeap.H.

Member Typedef Documentation

◆ Node

template<class Key , typename Compare = Aleph::less<Key>>
using Aleph::BinHeap< Key, Compare >::Node = BinHeapNode<Key>

El tipo de nodo del heap.

Definition at line 1006 of file tpl_binHeap.H.


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