Representation of binary trees in your programs
•	Similar to the lists, we can store binary trees in contiguous form and linked form
•	Linked form is conceptually simple
•	Contiguous form may not be quite that obvious
•	Binary tree is two dimensional while array (contiguous form) is one dimensional
•	What we need is mapping from two dimensions to one dimension
•	Complete a binary tree by adding dummy nodes with null values
•	Traverse it breadth first and store the items in the array as you go.
•	Binary tree is two dimensional while array (contiguous form) is one dimensional
•	What we need is mapping from two dimensions to one dimension
•	Complete a binary tree by adding dummy nodes with null values
•	Traverse it breadth first and store the items in the array as you go.
•	5,2,6,0,?,?,8,?,?,?,?,?,?,7,9
•	1,2,3,4,5,6,7,8,9,0,1,2,3,4,5

•	Actually, there is no need to complete the tree to put it in an array.
•	If an item goes in position I, its left child will be in position 2*I, and right child in position 2*I+1.
•	You can use this formula to find out position of each item in the tree. Use these positions to fill the array. Rest of the positions will have null values.
•	See another example from the board.
•	Generally, you don’t want to use the contiguous representation. But sometimes, we can look at an array as if it were a binary tree. This helps in applying some of the tree algorithms, such as heap sort to an array.
•	Properties of a binary tree:
•	Properties 1-4 on pp. 379-382.
•	See the derivations from the board.