23/03/2016 – Data Structure

Tree concepts

tree is a collection of one or more nodes

node at top – root

lines is edge, node with no edge down is leaves

same parent node = sibling, level of depth = degree,

maximum degree = height/depth

binary has at max 2 nodes, left and right child.

How to count depth = 2^k

How to find height = 2^(h+1) – 1

if nodes are known, minimum height = 2log(n), maximum height = n-1 where n is number of nodes.

 

Leave a Reply

Your email address will not be published. Required fields are marked *