Skip over navigation

Implementation of Trees


Implementing Tree

Implementation with Structs and Pointers

C  -  A functional programming language.
Static  -  Means that there is a fixed amount of memory allocated for the variable at the start of the program or function. This memory will exist for the duration of the program or function. It contrasts with dynamic.
Field  -  This is one of the elements in a struct. A struct joins together several variable types under one unit. The fields are the instances of the different variable types. If there are several elements of the same data type, they are still considered different fields.
Cell  -  An array consists of sequential locations to store a given data type. Each of these given locations is called a cell.
Sharp Defined Constant  -  Sharp define (#define) is a preprocessor directive which tells the processor to replace all instances in your program of one thing with another. For example #define MAX 5 will replace every occurence of MAX with the number 5.
Compile  -  The process of turning the code that you write into object code, the intermediate stage between the code you write and an executable program.
Implement  -  Taking an idea or design and making it actually happen in code.
Type  -  The process by which a chunk of memory is given meaning in C. If a variable is of a given type, say an int, then that chunk of memory is interpreted in a given way to get an integer value.
Struct  -  A means of creating one container for several distinct chunks of memory, possibly of different types. In this way, you can create one unit that holds several pieces of data, called fields, which can all be accessed from this one container.
Pointer  -  A means of storing the memory location (or address) of a variable. We call something a pointer because having the address of another variable is the equivalent of pointing to that other variable.
Array  -  An array is a linear sequence of cells of the same data type. In other words it is a large chunk of memory which is sectioned off such that each section represents one instance of the given data type. You can then index into the array to access any one of the cells.
Function  -  A tool that you write which you can call from your code that will execute a certain procedure, sometimes by taking input (the arguments) and sometimes by returning a value, the output.
Library  -  A set of functions that together allow one to make uses of a certain abstract object, such as a tree, without knowing the details of the implementation.
Binary Tree  -  A tree whose degree is two. In other words, the maximum number of children a node can have is two.

Follow Us