M
Moi
Hi,
Is there any AVL tree implementation
in C that does not use malloc ?
Currently, I am using a static array for a database that will be
frequently
searched / updated, but i would like
AVL trees. But the constraint is that the processor consumes more time
for dynamic memory allocation and
hence it affects the speed.
There is nothing wrong with using a statically allocated array of AVL-tree
nodes. The size is fixed, so you'll need to handle the case where your
array becomes exhausted. And you'll need to manage your own free list.
(which is not hard because the nodes contain at least two unused pointers)
HTH,
AvK