# What is the Height of the given ternary tree?

Category: QuestionsWhat is the Height of the given ternary tree?
Editor">Editor Staff asked 5 months ago

What is the Height of the given ternary tree?

(a) 0

(b) 1

(c) 2

(d) 3

The query is from Ternary tree in division Trees of Data Structures & Algorithms I

I have been asked this question during an online interview.

Editor">Editor Staff answered 5 months ago

The correct option is (c) 2

Best explanation: Height of the tree is defined as the length of the path from root node to the deepest node of the tree. Here deepest nodes are 5,6,7 which are at length 2. So the height of the ternary tree is 2.

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17
Articles: 40702