Dark Mode

1,239 views

2 votes

$\underline{\textbf{Answer:}\Rightarrow}\;\;\mathbf{c.}$

For finding inorder successor we just need to do the inorder traversal of the given tree.

The element which will come before the given element is called predecessor and the element which will come afterwards is called the successor.

Inorder traversal will be: $\mathbf{2\;3\;4\;6\;7\;9\;13\;\underline{15}\;\enclose{circle}{17}\;18\;20}$

For finding inorder successor we just need to do the inorder traversal of the given tree.

The element which will come before the given element is called predecessor and the element which will come afterwards is called the successor.

Inorder traversal will be: $\mathbf{2\;3\;4\;6\;7\;9\;13\;\underline{15}\;\enclose{circle}{17}\;18\;20}$

0 votes

Inorder successor of a node is a minimum element in right subtree of that node. Here $15's$ right subtree having $17$ as minimum element which is a inorder successor of $15$.

Morever if we write inorder of the given tree:

2, 3, 4, 6, 7, 9, 13, 15, **17**, 18, 20 element after 15 is inorder successor

**Option c) is correct**