Katkat

Implement right side view and local minimum search

MetaSoftware Engineer · Technical Screen

Last updated

This question evaluates a candidate's understanding of binary tree traversal and array local-minimum detection, measuring skills in data structures (binary trees and arrays), algorithm design, and algorithmic time-complexity analysis.

Question

LeetCode 199. Binary Tree Right Side View — Given the root of a binary tree, return the values of the nodes you can see ordered from top to bottom when the tree is viewed from the right side. Given an unsorted array of distinct integers, design an algorithm that returns the index of any local minimum (an element strictly smaller than its immediate neighbors). Assume the virtual elements beyond the ends are +∞. Provide the algorithm and analyze its time complexity.

https://leetcode.com/problems/binary-tree-right-side-view/description/