Node:Binary trees, Previous:Linked lists, Up:Lists and trees
Binary trees
A binary tree is a data structure in which each node contains
links to two successor nodes, so that the whole structure is shaped like
a branching tree. A typical use for a binary tree might be storing
genealogical information; since (at this point in human evolution) every
individual has two parents, each node can represent a person and the two
linked nodes can represent that person's mother and father. Let's
extend our personal_data
structure to incorporate this kind of
information:
struct personal_data { char name[100]; char address[200]; int year_of_birth; int month_of_birth; int day_of_birth; struct personal_data *mother; struct personal_data *father; };