LeetCode Question · Jan 2020 · San Francisco

Google | Phone | Kth ancestor of a node in an N-ary tree

5 upvotes 2,921 views 14 replies

Question Details

Given an N-ary tree where each node has a unique positive value. Implement a function: java class KthAncestor { public KthAncestor(Node root) { // pre } public int getAncestor(int n, int k) { // todo } } here n is...

Full Details

🔒

Unlock full leaked content

Full insider details, leaked discussions, and candidate experiences.

Get Premium →

Topics

Binary Tree