A binary tree is stored the way a heap is — children of index i at 2i+1 and 2i+2. Return the path from the root to a node in O(log n). A Verily onsite question.
A binary tree is stored the way a heap is — children of index i at 2i+1 and 2i+2. Return the path from the root to a node in O(log n). A Verily onsite question.
Unlock the full question, the code runner with test cases, and reference solution
One-time unlock. Yours forever.
Or get a for every question, unlimited code runs and AI mock interviews.
Be the first to discuss this question
Approaches, follow-up questions and how the interview went. Unlock the question to read and join the discussion.