Binary Tree Traversals What is a tree?

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/16

flashcard set

Earn XP

Description and Tags

a hierarchical data structure used to organize and represent data in a parent– child relationship. It consists of nodes, where the topmost node is called the root, and every other node can have one or more child nodes.

17 Terms

1
New cards

Tree Representation (N-1)


2
New cards

Basic Terminologies

Parent Node - a node that is an immediate predecessor of another node. Example: C is the parent of F and G.


3
New cards

Child Node

a node that is an immediate successor of another node. Example: D, E and F are children of B.


4
New cards

Root Node

the topmost node in a tree, which does not have a parent. Example:

15 is the root node.


5
New cards

Leaf Node (External Node)

nodes that do not have any children. Example: D, I, J, F, K, H are leaf nodes.


6
New cards

Ancestor

any node on the path from the root to a given node (excluding the node itself).

Example: 4, 2, 1 are ancestors of 7.


7
New cards

Descendant

a node x is a descendant of another node y if y is an ancestor of x. Example: h, d, e are descendants of b.


8
New cards

Sibling

nodes that share the same parent. Example: B and C are siblings, and I and J are siblings.


9
New cards

Internal Nodes

the node which has atleast one child.


10
New cards

Degree

the total number of children of a node has. The highest degree of a node among all the nodes in a tree is called as 'Degree of Tree'


11
New cards

Level of a Node

the number of edges in the path from the root to that node. The root node is at level 0.


12
New cards

Binary Tree

is a special type of tree data structure in which every node can have a maximum of 2 children. One is known as a left child and the other is known as right child.


13
New cards

Strictly Binary Tree

every node can have a maximum of two children. But in strictly binary tree, every node should have exactly two children or none


14
New cards

Strictly binary tree data structure is used to represent mathematical expressions.

knowt flashcard image
15
New cards

Complete Binary Tree

all levels are fully filled except possibly the last, which is filled from left to right.


16
New cards

Balanced Binary Tree

has at most 1 in difference between its left and right subtree heights, for each node in the tree.


17
New cards

Properties of Binary Trees

A binary tree is a special type of tree data structure in which every node can have a maximum of 2 children. One is known as a left child and the other is known as right child.