Skip to content
GATEiit

GATE CSE 2017 Session 1 Q16: Minimum and maximum height of a BST with 15 nodes

Syllabus topic: Trees, binary search trees and binary heaps

Question

Let T be a binary search tree with 15 nodes. The minimum and maximum possible heights of T are:

Note: The height of a tree with a single node is 0.

Try it: multiple choice: exactly one correct option

Select one option
Wrong answer costs 1/3 mark in GATE.
Show answer and explanation

Answer: B (official GATE 2017 final answer key)

Concept used: A binary tree of height h has at most 2h+1−1 nodes; the tallest tree is a chain.

Concept notes

Loading notes…

First step: Find the smallest h with 2h+1−1≥15, and count edges in a chain of 15 nodes.

Full step-by-step solution

Loading…

Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.

More questions on Trees, binary search trees and binary heaps

Every PYQ on this topic →

Share this question

WhatsAppDownload image

Source: official GATE 2017 Session 1 CS question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key