Challenge 5: Finding Nodes at "k" Distance From the Root
If you are given the root to a binary search tree and a node value k, can you write a code to find the nodes at k distance from the root?
Problem statement
Implement a function string findKNodes(Node* root, int k)
, which finds and returns nodes at k
distance from the root in the given ...
Access this course and 1400+ top-rated courses and projects.