0% found this document useful (0 votes)
3 views

Binary Trees

Uploaded by

nathan fitness
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Binary Trees

Uploaded by

nathan fitness
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Binary Trees

A binary tree is a data structure to represent hierarchy data

Think of it like an upside down tree with the root at the top and the branches coming down from it.,

Terminology

Nodes – the entities in the data structure tree

Edges- the lines connecting end nodes

Note that an tree with n nodes has n-1 edges

This is because every node has an incoming edge except from the root node)

Parent /child – any node that has other nodes below it is apparent note , the ones bellow are child
nodes

Siblings – nodes of the same parent

Leaf – a node that doesn’t have any children

Grandparent - self explanatory

Root – the top most node ( the root of the structure)

Sub tree-

Depth – the depth of a node is measured by how many edges it takes to get to it from the root node.

Height – this is the Longest path of edges from a node to a leaf. The height of A leaf node is zero

The height of a tree is the height of the root node.


Binary search tree is a binary tree where data with lesser values is stored in left nodes and data with
greater value is stored in the right nodes.

You might also like