What is the best way to create a binary tree in C language? [closed]

6

Being a binary tree a set of records that satisfies certain conditions. I would like to know how best to implement a binary search tree in C language would be using a headless or headless structure?  Not taking into account your scan mode e-r-d , r-e-d ... I know the address of a binary tree is the address of its root and so how should I proceed?

    
asked by anonymous 01.09.2015 / 15:24

1 answer

2

There are some factors that can interfere with the performance of both cases. The way of implementation and the content of this "head" can interfere with the performance analysis of the two methods of creating a binary tree. Every tree must have its root pointed so that it does not get lost in the memory, but not necessarily by a "head". Taking into account the same implementation for both cases, the tree that has no "head" will be accessed in a shorter time, since it has one less node in the middle of the path for access. The performance difference in access will be the access time to a node. This difference, although it exists almost will not be noticed, access is very fast.

    
01.09.2015 / 16:47