...

/

Challenge 3: Finding Ancestors of a Given Node in a BST

Challenge 3: Finding Ancestors of a Given Node in a BST

If you are given the root to a binary search tree and a node value k, can you write a code to find the ancestor of that node?

Problem statement

Implement the string findAncestors(Node *rootNode, int k) function, which will find the ancestors of the node whose value is “k.”. Here rootNode is the root node of a binary ...