Implementation of Trees


Implementing Tree

When we say a tree, we are talking about a way to structure data. The term tree on its own does not necessarily indicate one specific way of implementing this structure. Instead it just says that however we implement it, our implementation must allow for the data to be thought of in the general way that a tree structures data, as described in Section I.

This means that it will be up to you to decide exactly how to implement your trees using C Code. What all this means is that you will need to define some type in your code for a tree, of which you can then make variables. We will discuss a few very different approaches, such as one that uses structs and pointers and another that simply uses an ordinary array. The first of these two ways is the more generally used technique; the second is included more as an exercise in seeing how to use one data structure, the array, to implement a radically different structure, the tree.

Take a Study Break

SparkLife

Star Trek gets SEXY

Chris Pine and Zoe Saldana heat up the red carpet!

SparkLife

Are you afraid of relationships?

Auntie SparkNotes can help!

SparkLife

Wanna get JLaw's gorgeous glow?

Click here for simple, sexy makeup tricks!

SparkLife

Sexy starlet style

See every single look from the Met Gala!

SparkLife

Who'd be on your zombie-apocalypse crew?

We already dib'sed Genghis Khan.

Geek out!

The MindHut

Geeky Actors: Then and Now

Travel back in time!

The MindHut

Villains We Want These Actresses to Play

From super cute to super bad!

The MindHut

10 Movies Better Than Their Books

What do you think?

The MindHut

How To Look Like J-Law...

When you don't look like J-Law.

The MindHut

12 Scientific Inaccuracies in Into Darkness

What did Star Trek get wrong?

The Book

Cover image

Read What You Love, Anywhere You Like

Get Our FREE NOOK Reading Apps