B
Bogdan
Hi
I would like to check this result:
I have tested binary tree search API from Linux (search.h) by
searching into a binary tree generated from an unsorted dictionary a
given word. The second program uses the same dictionary, from which an
array is initialized which is sorted with qsort() then the same word
is searched with binary search fct (bsearch()).
Running both programs shows that the binary search (the second
program) is almost twice as fast as the binary tree search.
I have used directly the sorted distionary (so qsort() should have
the highest complexity), but still the second program is the fastest.
Is this the correct result ? What advantage has binary tree search
wrt qsort() followed by binary search ?
thanks
Bogdan
I would like to check this result:
I have tested binary tree search API from Linux (search.h) by
searching into a binary tree generated from an unsorted dictionary a
given word. The second program uses the same dictionary, from which an
array is initialized which is sorted with qsort() then the same word
is searched with binary search fct (bsearch()).
Running both programs shows that the binary search (the second
program) is almost twice as fast as the binary tree search.
I have used directly the sorted distionary (so qsort() should have
the highest complexity), but still the second program is the fastest.
Is this the correct result ? What advantage has binary tree search
wrt qsort() followed by binary search ?
thanks
Bogdan