Trees Library


A Tree Manipulation Library

Whenever you implement a new data type, it is usually a good idea to provide functions for manipulating it. There is a general concept in computer science referred to as the black box principle. It is the idea that the user of a data type should not need to be aware of how it is implemented because a library of functions is provided to interact with. This library separates the user from the implementation. This is a good idea because it allows you the programmer to change the implementation (and not the interface) at any point without the user of the data type having to worry about the change affecting his code. This concept is a central idea in Object-Oriented programming.

In the following SparkNote Topic, we will present some of the central functions that should be part of this library. The idea would then be to implement all of the functions together in the same .c file with their prototypes all in the same header file which the file using the tree data type should #include. For this particular implementation, we will use the tree node described in Section 1 of Topic I, which made use of structs and pointers.

Take a Study Break

SparkLife

The adorable Emma Watson!

Check out her 20 best red carpet looks here!

SparkLife

100 types of CRUSHES

Which have you crushed on?

SparkLife

Hot, fresh, celebrity tweets!

What are your favorite celebs saying? Click to find out!

SparkLife

Hate Bieber?

Read THIS.

Geek out!

The MindHut

We Rank the Doctors

Did we get it right?

The MindHut

Monsters of the Ocean

You'll never swim again.

The MindHut

Toop 10 Underrated Geniuses

They got no love!

The MindHut

Fantasy Book Covers...

...Recreated by THIS guy!

The MindHut

14 Animals That Changed the World

Proving history is totes adorbs.

The Book

Cover image

Read What You Love, Anywhere You Like

Get Our FREE NOOK Reading Apps