Managing Binary Trees – Linux

This post deals with an API for binary trees in Linux. The API consists of the following functions:

Function Brief Description
tdelete() Deletes an item from a tree.
tdestroy() Deletes the entire tree.
tfind() Finds an item and if not found returns NULL.
tsearch() Search a binary tree for an item.
twalk() Performs a depth-first, left to right tree traversal.

In the past I have used and implemented, using different programming languages, several classes, methods and functions to deal with binary trees. Binary trees are used to keep data in sorted order. This allows for quicker search times. This particular implementation comes with the Linux operating system. You can read more about it by typing on a Linux console:  man twalk Continue reading “Managing Binary Trees – Linux”