5 - Tree and Binary Tree - 2101702130 - Andrean

Pertemuan ke - 5 27-03-2018 Binary Tree Concept is a rooted tree data structure in which each node has at most two children. •Those two children usually distinguished as left child and right child. •Node which doesn’t have any child is called leaf. Type of Binary Tree • PERFECT binary tree is a binary tree in which every level are at the same depth. A perfect binary tree is a complete binary tree. • COMPLETE binary tree is a binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possible. • SKEWED binary tree is a binary tree in which each node has at most one child. • BALANCED binary tree is a binary tree in which no leaf is much farther away from the root than any other leaf (different balancing scheme allows different definitions of “much farther”). Property of Binary Tree ...