bheap.h File Reference
#include "abacus/array.h"
#include "abacus/bheap.inc"
Go to the source code of this file.
|
Classes |
class | ABA_BHEAP< Type, Key > |
| This template class implements a heap with a fixed maximal size, however a reallocation can be performed if required. More...
|
Detailed Description
- Author:
- Matthias Elf
A heap is the representation of a binary tree by an array a.
- The root of the tree is associated with a[0]. If a node corresponds to a[i], then its left son corresponds to a[2*i+1] and its right son to a[2*i+2]. This implicit binary tree is completely filled except possibly its highest level. Every item in the heap has to fulfil the heap property, i.e., its key has to be less than or equal than the keys of both sons.
- This template class implements a heap with a fixed maximal size, however a reallocation can be performed if required.
- The operations insert(), extractMin() require
running time if
elements are contained in the heap. The operation getMin() can even be executed in constant time. A heap can also be constructed from an ABA_BUFFER of
elements which requires a running time of
only.
- The order of the elements in the heap is given by keys which are inserted together with each element of the heap. The class Key must be from an ordered type. Given two objects k1 and k2 of type Key then k1 has higher priority if the expression k1 < k2 holds.
- License:
- This file is part of ABACUS - A Branch And CUt System Copyright (C) 1995 - 2003 University of Cologne, Germany
- This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
- This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- See also:
- http://www.gnu.org/copyleft/gpl.html
Definition in file bheap.h.
Generated on Tue Aug 14 18:09:54 2007 for ABACUS by
1.5.1