MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / _check_bst_before

Function _check_bst_before

examples/test/avl.c:191–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191static int _check_bst_before(struct rt_aspace *aspace, struct rt_varea *varea)
192{
193 rt_varea_t root = VAREA_ENTRY(aspace->tree.tree.root_node);
194 int height = _is_balanced(root);
195
196 if (root)
197 RT_ASSERT(height);
198
199 memset(_buf, 0, sizeof(_buf)); // clear first avoiding none tree error
200 _start = 0;
201 _boundary = 0;
202 _count = 0;
203
204 _aspace_traversal(aspace, _check_asc_before, varea);
205 int saved = _count;
206 _aspace_traversal_reverse(aspace, _check_asc_before_rev, varea);
207 _count = saved;
208
209 return 1;
210}
211
212static int _check_bst_after(struct rt_aspace *aspace, struct rt_varea *varea, int isdel)
213{

Callers 2

_aspace_bst_insertFunction · 0.85
_aspace_bst_removeFunction · 0.85

Calls 3

_is_balancedFunction · 0.85
_aspace_traversalFunction · 0.85

Tested by

no test coverage detected