Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

The GNU C Programming Tutorial - Binary trees

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;
};

 
 
  Published under free license. Design by Interspire