Dsa
Binary Search Tree
Easy
BST Height Calculation
Given the root node of a binary search tree, calculate its height. The height of a binary tree is the number of edges on the longest path from the root to a leaf. Implement the function that reads the serialized representation of a BST and prints its height.
The input is given as a string where nodes are separated by commas. A value of 'null' represents an absent child.
Example:
Input:
5,3,8,1,null,6,null
Output:
3
Key concepts
binary_search_treeheighttraversal
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now