summaryrefslogtreecommitdiff
path: root/navit/fib-1.1/fh_extractmin.3
blob: e1492b400b9d45b1b64bc7b7da6f50e4a6799437 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
.TH FH_EXTRACTMIN 3 "29 Mar 2000" "libfib"
.SH NAME
fh_extractmin \- extract minimum element from a Fibonacci Heap
.SH SYNOPSIS
#include <fib.h>
.PP
void *
.PD 0
.HP 8
.BR fh_extractmin "(struct fibheap *heap)"
.PD
.PP
void *
.PD 0
.HP 8
.BR fh_min "(struct fibheap *heap)"
.PD
.PP
void *
.PD 0
.HP 8
.BR fh_replacedata "(struct fibheap *heap, struct fibheap_el *elem, void *data)"
.PD
.PP
void *
.PD 0
.HP 8
.BR fh_delete "(struct fibheap *heap, struct fibheap_el *elem)"
.PD
.PP
void
.PD 0
.HP 8
.BR fh_deleteheap "(struct fibheap *heap)"
.PD
.PP
struct fibheap *
.PD 0
.HP 8
.BR fh_union "(struct fibheap *heapa, struct fibheap *heapb)"
.PD
.SH DESCRIPTION
These functions are shared between both key heaps and normal heaps.
.PP
Once a
.B elem
pointer has been passed to
.BR fh_delete (3)
that
.B elem
pointer may be reused to store another datum.
You should make sure that you destroy any copies of the pointer.
.SH RETURN VALUES
The
.B fh_extractmin
function returns the value of
.B data
that is the minimum element and removes it from the heap.
.PP
The
.B fh_min
function returns the current minimum element but does
.I not
remove it from the heap.
.PP
The
.B fh_replacedata
replaces the data in
.B elem
and returns the old data.
.PP
The
.B fh_delete
function removes
.B elem
from the heap, and returns the
.B data
that was stored in the element.
.PP
The
.B fh_deleteheap
complete destroys the heap.  It does not free any user supplied
.B data
elements stored in the heap.
.PP
The
.B fh_union
function returns the union of the two heaps
.B heapa
and
.BR heapb .
.SH SEE ALSO
.BR fh_makeheap (3),
.BR fh_makekeyheap (3)
.SH AUTHORS
This library and man page was writen by John-Mark Gurney <gurney_j@efn.org>.
.SH BUGS