btree.​docos4-​btree.​doc
1 TABLE·​OF·​CONTENTS1 TABLE·​OF·​CONTENTS
2 2
3 btree.​library/​-​-​background-​-​3 btree.​library/​-​-​background-​-​
4 btree.​library/​CreateTree4 btree.​library/​CreateTree
5 btree.​library/​DeleteTree5 btree.​library/​DeleteTree
6 btree.​library/​DeleteTreeNode6 btree.​library/​DeleteTreeNode
7 btree.​library/​EnumTreeNodes7 btree.​library/​EnumTreeNodes
8 btree.​library/​FindTreeNodeByData8 btree.​library/​FindTreeNodeByData
9 btree.​library/​FindTreeNodeByKey9 btree.​library/​FindTreeNodeByKey
10 btree.​library/​FlushTree10 btree.​library/​FlushTree
11 btree.​library/​ForTreeNodes11 btree.​library/​ForTreeNodes
12 btree.​library/​GetTreeHeight12 btree.​library/​GetTreeHeight
13 btree.​library/​GetTreeNodeData13 btree.​library/​GetTreeNodeData
14 btree.​library/​GetTreeNodeKey14 btree.​library/​GetTreeNodeKey
15 btree.​library/​GetTreeSize15 btree.​library/​GetTreeSize
16 btree.​library/​InsertTreeNode16 btree.​library/​InsertTreeNode
17 btree.​library/​MaxTreeNode17 btree.​library/​MaxTreeNode
18 btree.​library/​MinTreeNode18 btree.​library/​MinTreeNode
19 btree.​library/​PredTreeNode19 btree.​library/​PredTreeNode
20 btree.​library/​SetTreeNodeData20 btree.​library/​SetTreeNodeData
21 btree.​library/​SuccTreeNode21 btree.​library/​SuccTreeNode
22 btree.​library/​-​-​background-​-​22 btree.​library/​-​-​background-​-​·····················btree.​library/​-​-​background-​-​
23 23
24 ···​PURPOSE24 ···​PURPOSE
25 ····​The·​btree.​library·​provides·​transparent·​binary·​tree·​datatype25 ····​The·​btree.​library·​provides·​transparent·​binary·​tree·​datatype
26 ····​handling·​to·​applications.​26 ····​handling·​to·​applications.​
27 27
28 ···​OVERVIEW28 ···​OVERVIEW
29 ····​Binary·​trees·​are·​method·​to·​keep·​nodes·​sorted·​in·​a·​way·​that·​it·​is29 ····​Binary·​trees·​are·​method·​to·​keep·​nodes·​sorted·​in·​a·​way·​that·​it·​is
30 ····​very·​fast·​to·​add·​nodes·​and·​search·​for·​specific·​node.​30 ····​very·​fast·​to·​add·​nodes·​and·​search·​for·​specific·​node.​
31 31
32 ····​btree.​library·​provides·​generic·​binary·​tree·​API,​·​without·​limiting32 ····​btree.​library·​provides·​generic·​binary·​tree·​API,​·​without·​limiting
33 ····​the·​actual·​internal·​implementation.​·​The·​caller·​may·​ask·​for·​"default"33 ····​the·​actual·​internal·​implementation.​·​The·​caller·​may·​ask·​for·​"default"
34 ····​or·​specific·​tree·​type·​when·​creating·​the·​tree.​34 ····​or·​specific·​tree·​type·​when·​creating·​the·​tree.​
35 35
36 ···​IMPLEMENTATION36 ···​IMPLEMENTATION
37 ····​Current·​btree.​library·​implements·​AVL·​and·​Red-​Black·​balanced37 ····​Current·​btree.​library·​implements·​AVL·​and·​Red-​Black·​balanced
38 ····​binary·​tree·​routines.​·​The·​speed·​is·​in·​O(lg·​n)​·​category.​38 ····​binary·​tree·​routines.​·​The·​speed·​is·​in·​O(lg·​n)​·​category.​
39 39
40 ····​All·​functions·​and·​callbacks·​are·​sysv·​(PPC)​·​routines.​40 ····​All·​functions·​and·​callbacks·​are·​sysv·​(PPC)​·​routines.​
41 41
42 btree.​library/​CreateTree42 btree.​library/​CreateTree·····························btree.​library/​CreateTree
43 43
44 ···​NAME44 ···​NAME
45 ····​CreateTree·​-​-​·​allocate·​and·​initialize·​a·​binary·​tree45 ····​CreateTree·​-​-​·​allocate·​and·​initialize·​a·​binary·​tree
46 46
47 ···​SYNOPSIS47 ···​SYNOPSIS
48 ····​Tree·​=·​CreateTree(Type,​·​argArray)​48 ····​Tree·​=·​CreateTree(Type,​·​argArray)​
49 ····​(sysv)​49 ····​(sysv)​
50 50
51 ····​APTR·​CreateTree(ULONG,​·​const·​struct·​BTArgArray·​*)​;​51 ····​APTR·​CreateTree(ULONG,​·​const·​struct·​BTArgArray·​*)​;​
52 52
53 ···​FUNCTION53 ···​FUNCTION
54 ····​Create·​a·​binary·​tree.​·​This·​function·​must·​be·​called·​before·​other54 ····​Create·​a·​binary·​tree.​·​This·​function·​must·​be·​called·​before·​other
55 ····​functions,​·​and·​the·​returned·​Tree·​must·​be·​passed·​to·​the·​other55 ····​functions,​·​and·​the·​returned·​Tree·​must·​be·​passed·​to·​the·​other
56 ····​functions.​56 ····​functions.​
57 57
58 ···​INPUTS58 ···​INPUTS
59 ····​Type·····​-​·​Type·​of·​the·​binary·​tree·​to·​create.​·​One·​of:​59 ····​Type·····​-​·​Type·​of·​the·​binary·​tree·​to·​create.​·​One·​of:​
60 60
61 ···············​BT_DEFAULT61 ···············​BT_DEFAULT
62 ·················​The·​best·​overall·​generic·​tree·​algorithm.​·​This62 ·················​The·​best·​overall·​generic·​tree·​algorithm.​·​This
63 ·················​should·​be·​used·​most·​of·​the·​time.​63 ·················​should·​be·​used·​most·​of·​the·​time.​
64 64
65 ···············​BT_AVL_TREE65 ···············​BT_AVL_TREE
66 ·················​AVL·​balanced·​binary·​tree.​·​The·​average·​and66 ·················​AVL·​balanced·​binary·​tree.​·​The·​average·​and
67 ·················​worst-​case·​insert/​search·​time·​is·​O(lg·​n)​.​67 ·················​worst-​case·​insert/​search·​time·​is·​O(lg·​n)​.​
68 68
69 ···············​BT_RED_BLACK_TREE69 ···············​BT_RED_BLACK_TREE
70 ·················​Red-​Black·​balanced·​binary·​tree.​·​The·​average·​and70 ·················​Red-​Black·​balanced·​binary·​tree.​·​The·​average·​and
71 ·················​worst-​case·​insert/​search·​time·​is·​O(lg·​n)​.​·​Insert71 ·················​worst-​case·​insert/​search·​time·​is·​O(lg·​n)​.​·​Insert
72 ·················​is·​slightly·​faster·​than·​AVL·​tree,​·​but·​searching72 ·················​is·​slightly·​faster·​than·​AVL·​tree,​·​but·​searching
73 ·················​is·​slower.​73 ·················​is·​slower.​
74 74
75 ····​argArray·​-​·​struct·​BTArgArray·​initialized.​·​The·​structure·​has75 ····​argArray·​-​·​struct·​BTArgArray·​initialized.​·​The·​structure·​has
76 ···············​following·​fields:​76 ···············​following·​fields:​
77 77
78 ·········​Alloc·······​-​·​routine·​to·​call·​to·​allocate·​memory.​78 ·········​Alloc·······​-​·​routine·​to·​call·​to·​allocate·​memory.​
79 ·········​Free········​-​·​routine·​to·​call·​to·​free·​memory·​allocated·​by·​Alloc.​79 ·········​Free········​-​·​routine·​to·​call·​to·​free·​memory·​allocated·​by·​Alloc.​
80 ·········​Compare·····​-​·​node·​compare·​routine,​·​like·​qsort.​80 ·········​Compare·····​-​·​node·​compare·​routine,​·​like·​qsort.​
81 ·········​DestroyKey··​-​·​routine·​to·​call·​to·​destroy·​node's·​Key.​·​Optional.​81 ·········​DestroyKey··​-​·​routine·​to·​call·​to·​destroy·​node's·​Key.​·​Optional.​
82 ·········​DestroyData·​-​·​routine·​to·​call·​to·​destroy·​node's·​Data.​·​Optional.​82 ·········​DestroyData·​-​·​routine·​to·​call·​to·​destroy·​node's·​Data.​·​Optional.​
83 ·········​UserData····​-​·​userdata·​passed·​to·​functions·​above.​·​Optional.​83 ·········​UserData····​-​·​userdata·​passed·​to·​functions·​above.​·​Optional.​
84 84
85 ···​RESULT85 ···​RESULT
86 ····​Tree·​-​·​a·​pointer·​to·​the·​newly·​created·​empty·​Tree·​or·​NULL.​86 ····​Tree·​-​·​a·​pointer·​to·​the·​newly·​created·​empty·​Tree·​or·​NULL.​
87 87
88 ···​EXAMPLES88 ···​EXAMPLES
89 89
90 ····​APTR·​MyPool;​·​/​*·​Assumed·​initialized·*/​90 ····​APTR·​MyPool;​·​/​/​·​Assumed·​initialized
91 ····​APTR·​MyTree;​91 ····​APTR·​MyTree;​
92 92
93 ····​APTR·​MyAlloc(APTR·​userdata,​·​ULONG·​size)​93 ····​APTR·​MyAlloc(APTR·​userdata,​·​ULONG·​size)​
94 ····​{94 ····​{
95 ········​return·​AllocPooled(MyPool,​·​size)​;​95 ········​return·​AllocPooled(MyPool,​·​size)​;​
96 ····​}96 ····​}
97 97
98 ····​void·​MyFree(APTR·​userdata,​·​APTR·​ptr,​·​ULONG·​size)​98 ····​void·​MyFree(APTR·​userdata,​·​APTR·​ptr,​·​ULONG·​size)​
99 ····​{99 ····​{
100 ········​FreePooled(MyPool,​·​ptr,​·​size)​;​100 ········​FreePooled(MyPool,​·​ptr,​·​size)​;​
101 ····​}101 ····​}
102 102
103 ····​LONG·​MyCompare(APTR·​userdata,​·​const·​APTR·​keya,​·​const·​APTR·​keyb)​103 ····​LONG·​MyCompare(APTR·​userdata,​·​const·​APTR·​keya,​·​const·​APTR·​keyb)​
104 ····​{104 ····​{
105 ········​if·​(*(LONG*)​·​keya·​>·​*(LONG·​*)​·​keyb)​·​return·​1;​105 ········​if·​(*(LONG*)​·​keya·​>·​*(LONG·​*)​·​keyb)​·​return·​1;​
106 ········​else·​if·​(*(LONG*)​·​keya·​<·​*(LONG*)​·​keyb)​·​return·​-​1;​106 ········​else·​if·​(*(LONG*)​·​keya·​<·​*(LONG*)​·​keyb)​·​return·​-​1;​
107 ········​return·​0;​107 ········​return·​0;​
108 ····​}108 ····​}
109 109
110 ····​void·​MyDestroyKey(APTR·​userdata,​·​APTR·​key)​110 ····​void·​MyDestroyKey(APTR·​userdata,​·​APTR·​key)​
111 ····​{111 ····​{
112 ····​}112 ····​}
113 113
114 ····​void·​MyDestroyData(APTR·​userdata,​·​APTR·​data)​114 ····​void·​MyDestroyData(APTR·​userdata,​·​APTR·​data)​
115 ····​{115 ····​{
116 ····​}116 ····​}
117 117
118 ····/​*·​.​.​.​·*/​118 ····[·​.​.​.​·]
119 119
120 ····​const·​struct·​BTArgArray·​array·​=120 ····​const·​struct·​BTArgArray·​array·​=
121 ····​{121 ····​{
122 ········​MyAlloc,​122 ········​MyAlloc,​
123 ········​MyFree,​123 ········​MyFree,​
124 ········​MyCompare,​124 ········​MyCompare,​
125 ········​MyDestroyKey,​125 ········​MyDestroyKey,​
126 ········​MyDestroyData,​126 ········​MyDestroyData,​
127 ········​NULL127 ········​NULL
128 ····​};​128 ····​};​
129 129
130 ····​MyTree·​=·​CreateTree(BT_DEFAULT​,​·​&array)​;​130 ····​MyTree·​=·​CreateTree(BT_DEFAULT​,​·​&array)​;​
131 ····​if·​(MyTree)​131 ····​if·​(MyTree)​
132 ····​{132 ····​{
133 ········/​*·​.​.​.​·*/​133 ········[·​.​.​.​·]
134 134
135 ········​DeleteTree(MyTree)​;​135 ········​DeleteTree(MyTree)​;​
136 ····​}136 ····​}
137 137
138 ···​NOTE138 ···​NOTE
139 ····​The·​argArray·​is·​copied·​into·​the·​created·​Tree,​·​so·​it·​doesn't·​need139 ····​The·​argArray·​is·​copied·​into·​the·​created·​Tree,​·​so·​it·​doesn't·​need
140 ····​to·​stay·​available·​while·​the·​Tree·​is·​in·​use.​140 ····​to·​stay·​available·​while·​the·​Tree·​is·​in·​use.​
141 141
142 ···​BUGS
143 ····​DestroyKey·​and·​DestroyData·​can't·​be·​NULL·​prior·​btree.​library·​50.​5.​
144
145 ···​SEE·​ALSO142 ···​SEE·​ALSO
146 ····​DeleteTree,​·​libraries/​btree.​h143 ····​DeleteTree,​·​libraries/​btree.​h
147 144
148 btree.​library/​DeleteTree145 btree.​library/​DeleteTree·····························btree.​library/​DeleteTree
149 146
150 ···​NAME147 ···​NAME
151 ····​DeleteTree·​-​-​·​delete·​a·​binary·​tree148 ····​DeleteTree·​-​-​·​delete·​a·​binary·​tree
152 149
153 ···​SYNOPSIS150 ···​SYNOPSIS
154 ····​DeleteTree(Tree)​151 ····​DeleteTree(Tree)​
155 ····​(sysv)​152 ····​(sysv)​
156 153
157 ····​void·​DeleteTree(APTR)​;​154 ····​void·​DeleteTree(APTR)​;​
158 155
159 ···​FUNCTION156 ···​FUNCTION
160 ····​Deallocate·​a·​binary·​tree,​·​deallocating·​all·​the·​nodes.​157 ····​Deallocate·​a·​binary·​tree,​·​deallocating·​all·​the·​nodes.​
161 158
162 ···​INPUTS159 ···​INPUTS
163 ····​Tree·​-​·​tree·​to·​delete.​160 ····​Tree·​-​·​tree·​to·​delete.​
164 161
165 ···​RESULT162 ···​RESULT
166 163
167 ···​NOTE164 ···​NOTE
168 ····​argArray·​DestroyKey·​and·​DestroyData·​callbacks·​are·​called·​for165 ····​argArray·​DestroyKey·​and·​DestroyData·​callbacks·​are·​called·​for
169 ····​the·​deleted·​nodes.​166 ····​the·​deleted·​nodes.​
170 167
171 ···​SEE·​ALSO168 ···​SEE·​ALSO
172 ····​CreateTree,​·​libraries/​btree.​h169 ····​CreateTree,​·​libraries/​btree.​h
173 170
174 btree.​library/​DeleteTreeNode171 btree.​library/​DeleteTreeNode·····················btree.​library/​DeleteTreeNode
175 172
176 ···​NAME173 ···​NAME
177 ····​DeleteTreeNode·​-​-​·​delete·​node·​from·​binary·​tree174 ····​DeleteTreeNode·​-​-​·​delete·​node·​from·​binary·​tree
178 175
179 ···​SYNOPSIS176 ···​SYNOPSIS
180 ····​DeleteTreeNode(Tree,​·​Node)​177 ····​DeleteTreeNode(Tree,​·​Node)​
181 ····​(sysv)​178 ····​(sysv)​
182 179
183 ····​void·​DeleteTreeNode(APTR,​·​APTR)​;​180 ····​void·​DeleteTreeNode(APTR,​·​APTR)​;​
184 181
185 ···​FUNCTION182 ···​FUNCTION
186 ····​Remove·​and·​free·​a·​node·​from·​the·​binary·​tree.​183 ····​Remove·​and·​free·​a·​node·​from·​the·​binary·​tree.​
187 184
188 ···​INPUTS185 ···​INPUTS
189 ····​Tree·​-​·​tree·​to·​remove·​the·​node·​from.​186 ····​Tree·​-​·​tree·​to·​remove·​the·​node·​from.​
190 187
191 ····​Node·​-​·​pointer·​to·​node·​to·​remove.​188 ····​Node·​-​·​pointer·​to·​node·​to·​remove.​
192 189
193 ···​RESULT190 ···​RESULT
194 191
195 ···​NOTE192 ···​NOTE
196 ····​argArray·​DestroyKey·​and·​DestroyData·​callbacks·​are·​called·​for193 ····​argArray·​DestroyKey·​and·​DestroyData·​callbacks·​are·​called·​for
197 ····​the·​deleted·​node.​194 ····​the·​deleted·​node.​
198 195
199 ···​SEE·​ALSO196 ···​SEE·​ALSO
200 ····​InsertTreeNode,​·​libraries/​btree.​h197 ····​InsertTreeNode,​·​libraries/​btree.​h
201 198
202 btree.​library/​EnumTreeNodes199 btree.​library/​EnumTreeNodes·······················btree.​library/​EnumTreeNodes
203 200
204 ···​NAME201 ···​NAME
205 ····​EnumTreeNodes·​-​-​·​call·​a·​function·​for·​nodes·​between·​lowKey·​and·​highKey202 ····​EnumTreeNodes·​-​-​·​call·​a·​function·​for·​nodes·​between·​lowKey·​and·​highKey
206 203
207 ···​SYNOPSIS204 ···​SYNOPSIS
208 ····​NumNodes·​=·​EnumTreeNodes(Tree,​·​lowKey,​·​highKey,​·​nodeFunc,​·​userData)​205 ····​NumNodes·​=·​EnumTreeNodes(Tree,​·​lowKey,​·​highKey,​·​nodeFunc,​·​userData)​
209 ····​(sysv)​206 ····​(sysv)​
210 207
211 ····​ULONG·​EnumTreeNodes(const·​APTR,​·​const·​APTR,​·​const·​APTR,​208 ····​ULONG·​EnumTreeNodes(const·​APTR,​·​const·​APTR,​·​const·​APTR,​
212 ························​LONG·​(*)​(APTR,​·​const·​APTR)​,​·​const·​APTR)​;​209 ························​LONG·​(*)​(APTR,​·​const·​APTR)​,​·​const·​APTR)​;​
213 210
214 ···​FUNCTION211 ···​FUNCTION
215 ····​Call·​nodeFunc·​for·​all·​nodes·​between·​keys·​lowKey·​and·​highKey·​or·​until212 ····​Call·​nodeFunc·​for·​all·​nodes·​between·​keys·​lowKey·​and·​highKey·​or·​until
216 ····​nodeFunc·​return·​FALSE.​213 ····​nodeFunc·​return·​FALSE.​
217 214
218 ···​INPUTS215 ···​INPUTS
219 ····​Tree·​-​·​tree·​to·​call·​nodeFunc·​for.​216 ····​Tree·​-​·​tree·​to·​call·​nodeFunc·​for.​
220 217
221 ····​nodeFunc·​-​·​function·​to·​call·​for·​matching·​nodes.​218 ····​nodeFunc·​-​·​function·​to·​call·​for·​matching·​nodes.​
222 ···············​nodeFunc·​is·​called·​as:​219 ···············​nodeFunc·​is·​called·​as:​
223 ···············​LONG·​nodeFunc(APTR·​userData,​·​const·​APTR·​Node)​;​220 ···············​LONG·​nodeFunc(APTR·​userData,​·​const·​APTR·​Node)​;​
224 ···············​If·​nodeFunc·​return·​FALSE,​·​no·​further·​nodes221 ···············​If·​nodeFunc·​returns·​FALSE,​·​no·​further·​nodes
225 ···············​are·​enumerated.​222 ···············​are·​enumerated.​
226 223
227 ····​userData·​-​·​data·​pointer·​passed·​to·​nodeFunc.​224 ····​userData·​-​·​data·​pointer·​passed·​to·​nodeFunc.​
228 225
229 ···​RESULT226 ···​RESULT
230 ····​NumNodes·​-​·​number·​of·​nodes·​the·​nodeFunc·​got·​called·​for.​227 ····​NumNodes·​-​·​number·​of·​nodes·​the·​nodeFunc·​got·​called·​for.​
231 228
232 ···​NOTE229 ···​NOTE
233 ····​The·​nodes·​are·​called·​in·​ascending·​order.​230 ····​The·​nodes·​are·​called·​in·​ascending·​order.​
234 231
235 ···​SEE·​ALSO232 ···​SEE·​ALSO
236 ····​ForTreeNodes,​·​libraries/​btree.​h233 ····​ForTreeNodes,​·​libraries/​btree.​h
237 234
238 btree.​library/​FindTreeNodeByData235 btree.​library/​FindTreeNodeByData·············btree.​library/​FindTreeNodeByData
239 236
240 ···​NAME237 ···​NAME
241 ····​FindTreeNodeByData·​-​-​·​find·​a·​node·​by·​data.​238 ····​FindTreeNodeByData·​-​-​·​find·​a·​node·​by·​data.​
242 239
243 ···​SYNOPSIS240 ···​SYNOPSIS
244 ····​Node·​=·​FindTreeNodeByData(Tr​ee,​·​Data)​241 ····​Node·​=·​FindTreeNodeByData(Tr​ee,​·​Data)​
245 ····​(sysv)​242 ····​(sysv)​
246 243
247 ····​APTR·​FindTreeNodeByData(co​nst·​APTR,​·​const·​APTR)​;​244 ····​APTR·​FindTreeNodeByData(co​nst·​APTR,​·​const·​APTR)​;​
248 245
249 ···​FUNCTION246 ···​FUNCTION
250 ····​Return·​pointer·​to·​the·​node·​with·​the·​given·​data.​·​This·​routine·​is247 ····​Return·​pointer·​to·​the·​node·​with·​the·​given·​data.​·​This·​routine·​is
251 ····​very·​slow,​·​typically·​O(n^2)​.​·​Don't·​call·​this·​function·​without248 ····​very·​slow,​·​typically·​O(n^2)​.​·​Don't·​call·​this·​function·​without
252 ····​a·​good·​justification.​249 ····​a·​good·​justification.​
253 250
254 ···​INPUTS251 ···​INPUTS
255 ····​Tree·​-​·​tree·​to·​search·​a·​node·​from.​252 ····​Tree·​-​·​tree·​to·​search·​a·​node·​from.​
256 253
257 ····​Data·​-​·​data·​of·​the·​node·​to·​find.​254 ····​Data·​-​·​data·​of·​the·​node·​to·​find.​
258 255
259 ···​RESULT256 ···​RESULT
260 ····​Node·​-​·​the·​node·​with·​the·​data,​·​or·​NULL·​if·​no·​node·​with·​such·​data257 ····​Node·​-​·​the·​node·​with·​the·​data,​·​or·​NULL·​if·​no·​node·​with·​such·​data
261 ···········​was·​found.​258 ···········​was·​found.​
262 259
263 ···​NOTE260 ···​NOTE
264 ····​If·​multiple·​nodes·​have·​the·​same·​data·​there·​is·​no·​guarantee·​which261 ····​If·​multiple·​nodes·​have·​the·​same·​data·​there·​is·​no·​guarantee·​which
265 ····​of·​these·​nodes·​is·​actually·​returned.​262 ····​of·​these·​nodes·​is·​actually·​returned.​
266 263
267 ···​SEE·​ALSO264 ···​SEE·​ALSO
268 ····​FindTreeNodeByKey,​·​libraries/​btree.​h265 ····​FindTreeNodeByKey,​·​libraries/​btree.​h
269 266
270 btree.​library/​FindTreeNodeByKey267 btree.​library/​FindTreeNodeByKey···············btree.​library/​FindTreeNodeByKey
271 268
272 ···​NAME269 ···​NAME
273 ····​FindTreeNodeByKey·​-​-​·​find·​a·​node·​by·​key.​270 ····​FindTreeNodeByKey·​-​-​·​find·​a·​node·​by·​key.​
274 271
275 ···​SYNOPSIS272 ···​SYNOPSIS
276 ····​Node·​=·​FindTreeNodeByKey(Tre​e,​·​Key)​273 ····​Node·​=·​FindTreeNodeByKey(Tre​e,​·​Key)​
277 ····​(sysv)​274 ····​(sysv)​
278 275
279 ····​APTR·​FindTreeNodeByKey(con​st·​APTR,​·​const·​APTR)​;​276 ····​APTR·​FindTreeNodeByKey(con​st·​APTR,​·​const·​APTR)​;​
280 277
281 ···​FUNCTION278 ···​FUNCTION
282 ····​Return·​pointer·​to·​the·​node·​with·​the·​given·​key.​·​This·​routine·​is279 ····​Return·​pointer·​to·​the·​node·​with·​the·​given·​key.​·​This·​routine·​is
283 ····​very·​fast,​·​typically·​O(lg·​n)​.​280 ····​very·​fast,​·​typically·​O(lg·​n)​.​
284 281
285 ···​INPUTS282 ···​INPUTS
286 ····​Tree·​-​·​tree·​to·​search·​a·​node·​from.​283 ····​Tree·​-​·​tree·​to·​search·​a·​node·​from.​
287 284
288 ····​Key·​-​·​key·​of·​the·​node·​to·​find.​285 ····​Key·​-​·​key·​of·​the·​node·​to·​find.​
289 286
290 ···​RESULT287 ···​RESULT
291 ····​Node·​-​·​the·​node·​with·​the·​key,​·​or·​NULL·​if·​no·​node·​with·​such·​key288 ····​Node·​-​·​the·​node·​with·​the·​key,​·​or·​NULL·​if·​no·​node·​with·​such·​key
292 ···········​was·​found.​289 ···········​was·​found.​
293 290
294 ···​NOTE291 ···​NOTE
295 ····​If·​multiple·​nodes·​have·​the·​same·​key·​there·​is·​no·​guarantee·​which292 ····​If·​multiple·​nodes·​have·​the·​same·​key·​there·​is·​no·​guarantee·​which
296 ····​of·​these·​nodes·​is·​actually·​returned.​293 ····​of·​these·​nodes·​is·​actually·​returned.​
297 294
298 ···​SEE·​ALSO295 ···​SEE·​ALSO
299 ····​FindTreeNodeByData,​·​libraries/​btree.​h296 ····​FindTreeNodeByData,​·​libraries/​btree.​h
300 297
301 btree.​library/​FlushTree298 btree.​library/​FlushTree·······························btree.​library/​FlushTree
302 299
303 ···​NAME300 ···​NAME
304 ····​FlushTree·​-​-​·​delete·​all·​nodes·​in·​a·​binary·​tree301 ····​FlushTree·​-​-​·​delete·​all·​nodes·​in·​a·​binary·​tree
305 302
306 ···​SYNOPSIS303 ···​SYNOPSIS
307 ····​FlushTree(Tree)​304 ····​FlushTree(Tree)​
308 ····​(sysv)​305 ····​(sysv)​
309 306
310 ····​void·​FlushTree(APTR)​;​307 ····​void·​FlushTree(APTR)​;​
311 308
312 ···​FUNCTION309 ···​FUNCTION
313 ····​Deallocate·​all·​nodes·​in·​a·​binary·​tree.​·​The·​tree·​is·​in·​the310 ····​Deallocate·​all·​nodes·​in·​a·​binary·​tree.​·​The·​tree·​is·​in·​the
314 ····​empty·​state·​like·​after·​CreateTree.​311 ····​empty·​state·​like·​after·​CreateTree.​
315 312
316 ···​INPUTS313 ···​INPUTS
317 ····​Tree·​-​·​tree·​to·​delete·​nodes·​from.​314 ····​Tree·​-​·​tree·​to·​delete·​nodes·​from.​
318 315
319 ···​RESULT316 ···​RESULT
320 317
321 ···​NOTE318 ···​NOTE
322 ····​argArray·​DestroyKey·​and·​DestroyData·​callbacks·​are·​called·​for319 ····​argArray·​DestroyKey·​and·​DestroyData·​callbacks·​are·​called·​for
323 ····​the·​deleted·​nodes.​320 ····​the·​deleted·​nodes.​
324 321
325 ···​BUGS
326 ····​BT_RED_BLACK_TREE·​FlushTree·​was·​broken·​before·​V50.​7.​
327
328 ···​SEE·​ALSO322 ···​SEE·​ALSO
329 ····​DeleteTree,​·​libraries/​btree.​h323 ····​DeleteTree,​·​libraries/​btree.​h
330 324
331 btree.​library/​ForTreeNodes325 btree.​library/​ForTreeNodes·························btree.​library/​ForTreeNodes
332 326
333 ···​NAME327 ···​NAME
334 ····​ForTreeNodes·​-​-​·​call·​a·​function·​for·​all·​nodes·​in·​a·​tree.​328 ····​ForTreeNodes·​-​-​·​call·​a·​function·​for·​all·​nodes·​in·​a·​tree.​
335 329
336 ···​SYNOPSIS330 ···​SYNOPSIS
337 ····​NumNodes·​=·​ForTreeNodes(Tree,​·​nodeFunc,​·​userData)​331 ····​NumNodes·​=·​ForTreeNodes(Tree,​·​nodeFunc,​·​userData)​
338 ····​(sysv)​332 ····​(sysv)​
339 333
340 ····​ULONG·​ForTreeNodes(const·​APTR,​·​void·​(*)​(APTR,​·​const·​APTR)​,​·​APTR)​;​334 ····​ULONG·​ForTreeNodes(const·​APTR,​·​void·​(*)​(APTR,​·​const·​APTR)​,​·​APTR)​;​
341 335
342 ···​FUNCTION336 ···​FUNCTION
343 ····​Call·​nodeFunc·​for·​all·​nodes·​in·​the·​tree.​337 ····​Call·​nodeFunc·​for·​all·​nodes·​in·​the·​tree.​
344 338
345 ···​INPUTS339 ···​INPUTS
346 ····​Tree·​-​·​tree·​to·​call·​nodeFunc·​for.​340 ····​Tree·​-​·​tree·​to·​call·​nodeFunc·​for.​
347 341
348 ····​nodeFunc·​-​·​function·​to·​call·​for·​each·​node.​342 ····​nodeFunc·​-​·​function·​to·​call·​for·​each·​node.​
349 ···············​nodeFunc·​is·​called·​as:​343 ···············​nodeFunc·​is·​called·​as:​
350 ···············​void·​nodeFunc(APTR·​userData,​·​const·​APTR·​Node)​;​344 ···············​void·​nodeFunc(APTR·​userData,​·​const·​APTR·​Node)​;​
351 345
352 ····​userData·​-​·​data·​pointer·​passed·​to·​nodeFunc.​346 ····​userData·​-​·​data·​pointer·​passed·​to·​nodeFunc.​
353 347
354 ···​RESULT348 ···​RESULT
355 ····​NumNodes·​-​·​number·​of·​nodes·​the·​nodeFunc·​got·​called·​for.​349 ····​NumNodes·​-​·​number·​of·​nodes·​the·​nodeFunc·​got·​called·​for.​
356 350
357 ···​NOTE351 ···​NOTE
358 ····​The·​nodes·​are·​not·​called·​in·​any·​partifular·​order,​·​typically352 ····​The·​nodes·​are·​not·​called·​in·​any·​partifular·​order,​·​typically
359 ····​in·​the·​fastest·​possible·​order·​for·​the·​internal·​implementation.​353 ····​in·​the·​fastest·​possible·​order·​for·​the·​internal·​implementation.​
360 354
361 ···​SEE·​ALSO355 ···​SEE·​ALSO
362 ····​EnumTreeNodes,​·​libraries/​btree.​h356 ····​EnumTreeNodes,​·​libraries/​btree.​h
363 357
364 btree.​library/​GetTreeHeight358 btree.​library/​GetTreeHeight·······················btree.​library/​GetTreeHeight
365 359
366 ···​NAME360 ···​NAME
367 ····​GetTreeHeight·​-​-​·​get·​height·​of·​the·​tree361 ····​GetTreeHeight·​-​-​·​get·​height·​of·​the·​tree
368 362
369 ···​SYNOPSIS363 ···​SYNOPSIS
370 ····​Height·​=·​GetTreeHeight(Tree)​364 ····​Height·​=·​GetTreeHeight(Tree)​
371 ····​(sysv)​365 ····​(sysv)​
372 366
373 ····​ULONG·​GetTreeHeight(const·​APTR)​;​367 ····​ULONG·​GetTreeHeight(const·​APTR)​;​
374 368
375 ···​FUNCTION369 ···​FUNCTION
376 ····​Return·​height·​of·​the·​tree.​·​For·​example·​for·​a·​tree:​370 ····​Return·​height·​of·​the·​tree.​·​For·​example·​for·​a·​tree:​
377 371
378 ··········​a372 ··········​a
379 ········​/​···​\373 ········​/​···​\
380 ·······​b·····​c374 ·······​b·····​c
381 ·····​/​···​\375 ·····​/​···​\
382 ····​d·····​e376 ····​d·····​e
383 377
384 ····​.​.​.​this·​function·​would·​return·​3.​378 ····​.​.​.​this·​function·​would·​return·​3.​
385 379
386 ···​INPUTS380 ···​INPUTS
387 ····​Tree·​-​·​tree·​to·​count·​the·​height·​for.​381 ····​Tree·​-​·​tree·​to·​count·​the·​height·​for.​
388 382
389 ···​RESULT383 ···​RESULT
390 ····​Height·​-​·​height·​of·​the·​tree.​384 ····​Height·​-​·​height·​of·​the·​tree.​
391 385
392 ···​NOTE386 ···​NOTE
393 387
394 ···​SEE·​ALSO388 ···​SEE·​ALSO
395 ····​GetTreeSize,​·​libraries/​btree.​h389 ····​GetTreeSize,​·​libraries/​btree.​h
396 390
397 btree.​library/​GetTreeNodeData391 btree.​library/​GetTreeNodeData···················btree.​library/​GetTreeNodeData
398 392
399 ···​NAME393 ···​NAME
400 ····​GetTreeNodeData·​-​-​·​get·​data·​of·​the·​node394 ····​GetTreeNodeData·​-​-​·​get·​data·​of·​the·​node
401 395
402 ···​SYNOPSIS396 ···​SYNOPSIS
403 ····​Data·​=·​GetTreeNodeData(Tree,​·​Node)​397 ····​Data·​=·​GetTreeNodeData(Tree,​·​Node)​
404 ····​(sysv)​398 ····​(sysv)​
405 399
406 ····​APTR·​GetTreeNodeData(const​·​APTR,​·​const·​APTR)​;​400 ····​APTR·​GetTreeNodeData(const​·​APTR,​·​const·​APTR)​;​
407 401
408 ···​FUNCTION402 ···​FUNCTION
409 ····​Return·​data·​of·​the·​node.​403 ····​Return·​data·​of·​the·​node.​
410 404
411 ···​INPUTS405 ···​INPUTS
412 ····​Tree·​-​·​tree·​the·​node·​belongs·​to.​406 ····​Tree·​-​·​tree·​the·​node·​belongs·​to.​
413 407
414 ····​Node·​-​·​node·​to·​get·​data·​of.​408 ····​Node·​-​·​node·​to·​get·​data·​of.​
415 409
416 ···​RESULT410 ···​RESULT
417 ····​Data·​-​·​data·​of·​the·​given·​node.​411 ····​Data·​-​·​data·​of·​the·​given·​node.​
418 412
419 ···​NOTE413 ···​NOTE
420 414
421 ···​SEE·​ALSO415 ···​SEE·​ALSO
422 ····​GetTreeNodeKey,​·​libraries/​btree.​h416 ····​GetTreeNodeKey,​·​libraries/​btree.​h
423 417
424 btree.​library/​GetTreeNodeKey418 btree.​library/​GetTreeNodeKey·····················btree.​library/​GetTreeNodeKey
425 419
426 ···​NAME420 ···​NAME
427 ····​GetTreeNodeKey·​-​-​·​get·​key·​of·​the·​node421 ····​GetTreeNodeKey·​-​-​·​get·​key·​of·​the·​node
428 422
429 ···​SYNOPSIS423 ···​SYNOPSIS
430 ····​Key·​=·​GetTreeNodeKey(Tree,​·​Node)​424 ····​Key·​=·​GetTreeNodeKey(Tree,​·​Node)​
431 ····​(sysv)​425 ····​(sysv)​
432 426
433 ····​APTR·​GetTreeNodeKey(const·​APTR,​·​const·​APTR)​;​427 ····​APTR·​GetTreeNodeKey(const·​APTR,​·​const·​APTR)​;​
434 428
435 ···​FUNCTION429 ···​FUNCTION
436 ····​Return·​key·​of·​the·​node.​430 ····​Return·​key·​of·​the·​node.​
437 431
438 ···​INPUTS432 ···​INPUTS
439 ····​Tree·​-​·​tree·​the·​node·​belongs·​to.​433 ····​Tree·​-​·​tree·​the·​node·​belongs·​to.​
440 434
441 ····​Node·​-​·​node·​to·​get·​key·​of.​435 ····​Node·​-​·​node·​to·​get·​key·​of.​
442 436
443 ···​RESULT437 ···​RESULT
444 ····​Key·​-​·​key·​of·​the·​given·​node.​438 ····​Key·​-​·​key·​of·​the·​given·​node.​
445 439
446 ···​NOTE440 ···​NOTE
447 441
448 ···​SEE·​ALSO442 ···​SEE·​ALSO
449 ····​GetTreeNodeData,​·​libraries/​btree.​h443 ····​GetTreeNodeData,​·​libraries/​btree.​h
450 444
451 btree.​library/​GetTreeSize445 btree.​library/​GetTreeSize···························btree.​library/​GetTreeSize
452 446
453 ···​NAME447 ···​NAME
454 ····​GetTreeSize·​-​-​·​get·​total·​number·​of·​nodes·​in·​a·​tree448 ····​GetTreeSize·​-​-​·​get·​total·​number·​of·​nodes·​in·​a·​tree
455 449
456 ···​SYNOPSIS450 ···​SYNOPSIS
457 ····​NumNodes·​=·​GetTreeSize(Tree)​451 ····​NumNodes·​=·​GetTreeSize(Tree)​
458 ····​(sysv)​452 ····​(sysv)​
459 453
460 ····​ULONG·​GetTreeSize(const·​APTR)​;​454 ····​ULONG·​GetTreeSize(const·​APTR)​;​
461 455
462 ···​FUNCTION456 ···​FUNCTION
463 ····​Return·​total·​number·​of·​nodes·​in·​the·​tree.​457 ····​Return·​total·​number·​of·​nodes·​in·​the·​tree.​
464 458
465 ···​INPUTS459 ···​INPUTS
466 ····​Tree·​-​·​tree·​to·​count·​the·​nodes·​from.​460 ····​Tree·​-​·​tree·​to·​count·​the·​nodes·​from.​
467 461
468 ···​RESULT462 ···​RESULT
469 ····​NumNodes·​-​·​total·​number·​of·​nodes.​463 ····​NumNodes·​-​·​total·​number·​of·​nodes.​
470 464
471 ···​NOTE465 ···​NOTE
472 466
473 ···​SEE·​ALSO467 ···​SEE·​ALSO
474 ····​GetTreeHeight,​·​libraries/​btree.​h468 ····​GetTreeHeight,​·​libraries/​btree.​h
475 469
476 btree.​library/​InsertTreeNode470 btree.​library/​InsertTreeNode·····················btree.​library/​InsertTreeNode
477 471
478 ···​NAME472 ···​NAME
479 ····​InsertTreeNode·​-​-​·​insert·​key/​data·​pair·​to·​binary·​tree473 ····​InsertTreeNode·​-​-​·​insert·​key/​data·​pair·​to·​binary·​tree
480 474
481 ···​SYNOPSIS475 ···​SYNOPSIS
482 ····​Node·​=·​InsertTreeNode(Tree,​·​Key,​·​Data)​476 ····​Node·​=·​InsertTreeNode(Tree,​·​Key,​·​Data)​
483 ····​(sysv)​477 ····​(sysv)​
484 478
485 ····​APTR·​InsertTreeNode(APTR,​·​const·​APTR,​·​const·​APTR)​;​479 ····​APTR·​InsertTreeNode(APTR,​·​const·​APTR,​·​const·​APTR)​;​
486 480
487 ···​FUNCTION481 ···​FUNCTION
488 ····​Insert·​a·​node·​into·​the·​binary·​tree,​·​with·​key·​'Key'·​and·​data482 ····​Insert·​a·​node·​into·​the·​binary·​tree,​·​with·​key·​'Key'·​and·​data
489 ····​pointer·​'Data'.​·​The·​tree·​is·​sorted·​by·​'Key'·​using·​argArray483 ····​pointer·​'Data'.​·​The·​tree·​is·​sorted·​by·​'Key'·​using·​argArray
490 ····​Compare.​484 ····​Compare.​
491 485
492 ···​INPUTS486 ···​INPUTS
493 ····​Tree·​-​·​tree·​to·​insert·​node·​to.​487 ····​Tree·​-​·​tree·​to·​insert·​node·​to.​
494 488
495 ····​Key·​-​·​key·​of·​the·​node.​489 ····​Key·​-​·​key·​of·​the·​node.​
496 490
497 ····​Data·​-​·​data·​pointer·​related·​to·​key.​491 ····​Data·​-​·​data·​pointer·​related·​to·​key.​
498 492
499 ···​RESULT493 ···​RESULT
500 ····​Node·​-​·​pointer·​to·​newly·​created·​node,​·​or·​NULL.​494 ····​Node·​-​·​pointer·​to·​newly·​created·​node,​·​or·​NULL.​
501 495
502 ···​NOTE496 ···​NOTE
503 497
504 ···​SEE·​ALSO498 ···​SEE·​ALSO
505 ····​DeleteTreeNode,​·​libraries/​btree.​h499 ····​DeleteTreeNode,​·​libraries/​btree.​h
506 500
507 btree.​library/​MaxTreeNode501 btree.​library/​MaxTreeNode···························btree.​library/​MaxTreeNode
508 502
509 ···​NAME503 ···​NAME
510 ····​MaxTreeNode·​-​-​·​get·​pointer·​to·​the·​node·​with·​highest·​key.​504 ····​MaxTreeNode·​-​-​·​get·​pointer·​to·​the·​node·​with·​highest·​key.​
511 505
512 ···​SYNOPSIS506 ···​SYNOPSIS
513 ····​MaxNode·​=·​MaxTreeNode(Tree)​507 ····​MaxNode·​=·​MaxTreeNode(Tree)​
514 ····​(sysv)​508 ····​(sysv)​
515 509
516 ····​APTR·​MaxTreeNode(const·​APTR)​;​510 ····​APTR·​MaxTreeNode(const·​APTR)​;​
517 511
518 ···​FUNCTION512 ···​FUNCTION
519 ····​Return·​pointer·​to·​the·​node·​with·​highest·​key.​513 ····​Return·​pointer·​to·​the·​node·​with·​highest·​key.​
520 514
521 ···​INPUTS515 ···​INPUTS
522 ····​Tree·​-​·​tree·​to·​get·​the·​highest·​key·​node·​of.​516 ····​Tree·​-​·​tree·​to·​get·​the·​highest·​key·​node·​of.​
523 517
524 ···​RESULT518 ···​RESULT
525 ····​MaxNode·​-​·​the·​node·​with·​the·​highest·​key,​·​or·​NULL·​if·​empty·​tree.​519 ····​MaxNode·​-​·​the·​node·​with·​the·​highest·​key,​·​or·​NULL·​if·​empty·​tree.​
526 520
527 ···​NOTE521 ···​NOTE
528 522
529 ···​SEE·​ALSO523 ···​SEE·​ALSO
530 ····​MinTreeNode,​·​libraries/​btree.​h524 ····​MinTreeNode,​·​libraries/​btree.​h
531 525
532 btree.​library/​MinTreeNode526 btree.​library/​MinTreeNode···························btree.​library/​MinTreeNode
533 527
534 ···​NAME528 ···​NAME
535 ····​MinTreeNode·​-​-​·​get·​pointer·​to·​the·​node·​with·​lowest·​key.​529 ····​MinTreeNode·​-​-​·​get·​pointer·​to·​the·​node·​with·​lowest·​key.​
536 530
537 ···​SYNOPSIS531 ···​SYNOPSIS
538 ····​MinNode·​=·​MinTreeNode(Tree)​532 ····​MinNode·​=·​MinTreeNode(Tree)​
539 ····​(sysv)​533 ····​(sysv)​
540 534
541 ····​APTR·​MinTreeNode(const·​APTR)​;​535 ····​APTR·​MinTreeNode(const·​APTR)​;​
542 536
543 ···​FUNCTION537 ···​FUNCTION
544 ····​Return·​pointer·​to·​the·​node·​with·​lowest·​key.​538 ····​Return·​pointer·​to·​the·​node·​with·​lowest·​key.​
545 539
546 ···​INPUTS540 ···​INPUTS
547 ····​Tree·​-​·​tree·​to·​get·​the·​lowest·​key·​node·​of.​541 ····​Tree·​-​·​tree·​to·​get·​the·​lowest·​key·​node·​of.​
548 542
549 ···​RESULT543 ···​RESULT
550 ····​MinNode·​-​·​the·​node·​with·​the·​lowest·​key,​·​or·​NULL·​if·​empty·​tree.​544 ····​MinNode·​-​·​the·​node·​with·​the·​lowest·​key,​·​or·​NULL·​if·​empty·​tree.​
551 545
552 ···​NOTE546 ···​NOTE
553 547
554 ···​SEE·​ALSO548 ···​SEE·​ALSO
555 ····​MaxTreeNode,​·​libraries/​btree.​h549 ····​MaxTreeNode,​·​libraries/​btree.​h
556 550
557 btree.​library/​PredTreeNode551 btree.​library/​PredTreeNode·························btree.​library/​PredTreeNode
558 552
559 ···​NAME553 ···​NAME
560 ····​PredTreeNode·​-​-​·​get·​pointer·​to·​previous·​node554 ····​PredTreeNode·​-​-​·​get·​pointer·​to·​previous·​node
561 555
562 ···​SYNOPSIS556 ···​SYNOPSIS
563 ····​PredNode·​=·​PredTreeNode(Tree,​·​Node)​557 ····​PredNode·​=·​PredTreeNode(Tree,​·​Node)​
564 ····​(sysv)​558 ····​(sysv)​
565 559
566 ····​APTR·​PredTreeNode(const·​APTR,​·​const·​APTR)​;​560 ····​APTR·​PredTreeNode(const·​APTR,​·​const·​APTR)​;​
567 561
568 ···​FUNCTION562 ···​FUNCTION
569 ····​Return·​pointer·​to·​previous·​node.​563 ····​Return·​pointer·​to·​previous·​node.​
570 564
571 ···​INPUTS565 ···​INPUTS
572 ····​Tree·​-​·​tree·​the·​node·​belongs·​to.​566 ····​Tree·​-​·​tree·​the·​node·​belongs·​to.​
573 567
574 ····​Node·​-​·​node·​to·​get·​predecessor·​of.​568 ····​Node·​-​·​node·​to·​get·​predecessor·​of.​
575 569
576 ···​RESULT570 ···​RESULT
577 ····​PredNode·​-​·​previous·​node·​pointer·​or·​NULL·​if·​no·​more·​nodes.​571 ····​PredNode·​-​·​previous·​node·​pointer·​or·​NULL·​if·​no·​more·​nodes.​
578 572
579 ···​NOTE573 ···​NOTE
580 574
581 ···​SEE·​ALSO575 ···​SEE·​ALSO
582 ····​SuccTreeNode,​·​libraries/​btree.​h576 ····​SuccTreeNode,​·​libraries/​btree.​h
583 577
584 btree.​library/​SetTreeNodeData578 btree.​library/​SetTreeNodeData···················btree.​library/​SetTreeNodeData
585 579
586 ···​NAME580 ···​NAME
587 ····​SetTreeNodeData·​-​-​·​set·​data·​of·​the·​node·​(V50.​7)​581 ····​SetTreeNodeData·​-​-​·​set·​data·​of·​the·​node·​(V50.​7)​
588 582
589 ···​SYNOPSIS583 ···​SYNOPSIS
590 ····​OldData·​=·​SetTreeNodeData(Tree,​·​Node,​·​NewData)​584 ····​OldData·​=·​SetTreeNodeData(Tree,​·​Node,​·​NewData)​
591 ····​(sysv)​585 ····​(sysv)​
592 586
593 ····​APTR·​GetTreeNodeData(const​·​APTR,​·​APTR,​·​const·​APTR)​;​587 ····​APTR·​GetTreeNodeData(const​·​APTR,​·​APTR,​·​const·​APTR)​;​
594 588
595 ···​FUNCTION589 ···​FUNCTION
596 ····​Set·​new·​data·​for·​the·​node,​·​return·​old·​data.​590 ····​Set·​new·​data·​for·​the·​node,​·​return·​old·​data.​
597 591
598 ···​INPUTS592 ···​INPUTS
599 ····​Tree·​-​·​tree·​the·​node·​belongs·​to.​593 ····​Tree·​-​·​tree·​the·​node·​belongs·​to.​
600 594
601 ····​Node·​-​·​node·​to·​set·​data·​of.​595 ····​Node·​-​·​node·​to·​set·​data·​of.​
602 596
603 ····​NewData·​-​·​new·​data·​for·​the·​given·​node.​597 ····​NewData·​-​·​new·​data·​for·​the·​given·​node.​
604 598
605 ···​RESULT599 ···​RESULT
606 ····​OldData·​-​·​previous·​data·​of·​the·​given·​node.​600 ····​OldData·​-​·​previous·​data·​of·​the·​given·​node.​
607 601
608 ···​NOTE602 ···​NOTE
609 ····​There·​is·​no·​SetTreeNodeKey,​·​for·​obvious·​reasons.​603 ····​There·​is·​no·​SetTreeNodeKey,​·​for·​obvious·​reasons.​
610 ····​This·​function·​didn't·​exist·​before·​V50.​7.​·​You·​MUST·​check604 ····​This·​function·​didn't·​exist·​before·​V50.​7.​·​You·​MUST·​check
611 ····​for·​version·​&·​revision·​before·​using·​this·​function.​605 ····​for·​version·​&·​revision·​before·​using·​this·​function.​
612 606
613 ···​SEE·​ALSO607 ···​SEE·​ALSO
614 ····​GetTreeNodeData,​·​libraries/​btree.​h608 ····​GetTreeNodeData,​·​libraries/​btree.​h
615 609
616 btree.​library/​SuccTreeNode610 btree.​library/​SuccTreeNode·························btree.​library/​SuccTreeNode
617 611
618 ···​NAME612 ···​NAME
619 ····​SuccTreeNode·​-​-​·​get·​pointer·​to·​next·​node613 ····​SuccTreeNode·​-​-​·​get·​pointer·​to·​next·​node
620 614
621 ···​SYNOPSIS615 ···​SYNOPSIS
622 ····​SuccNode·​=·​SuccTreeNode(Tree,​·​Node)​616 ····​SuccNode·​=·​SuccTreeNode(Tree,​·​Node)​
623 ····​(sysv)​617 ····​(sysv)​
624 618
625 ····​APTR·​SuccTreeNode(const·​APTR,​·​const·​APTR)​;​619 ····​APTR·​SuccTreeNode(const·​APTR,​·​const·​APTR)​;​
626 620
627 ···​FUNCTION621 ···​FUNCTION
628 ····​Return·​pointer·​to·​next·​node.​622 ····​Return·​pointer·​to·​next·​node.​
629 623
630 ···​INPUTS624 ···​INPUTS
631 ····​Tree·​-​·​tree·​the·​node·​belongs·​to.​625 ····​Tree·​-​·​tree·​the·​node·​belongs·​to.​
632 626
633 ····​Node·​-​·​node·​to·​get·​successor·​of.​627 ····​Node·​-​·​node·​to·​get·​successor·​of.​
634 628
635 ···​RESULT629 ···​RESULT
636 ····​SuccNode·​-​·​next·​node·​pointer·​or·​NULL·​if·​no·​more·​nodes.​630 ····​SuccNode·​-​·​next·​node·​pointer·​or·​NULL·​if·​no·​more·​nodes.​
637 631
638 ···​NOTE632 ···​NOTE
639 633
640 ···​SEE·​ALSO634 ···​SEE·​ALSO
641 ····​PredTreeNode,​·​libraries/​btree.​h635 ····​PredTreeNode,​·​libraries/​btree.​h
642 636
643 637
\ No newline at end of file