Quick Overview

Find the longest path of equal-valued nodes in a binary tree encoded as a breadth-first list. Clarify the ambiguity with strict BST terminology, then compute both one-sided and through-node paths in linear time without unsafe recursion.

Find the Longest Path of Equal-Valued Tree Nodes

Company: Google

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

Overview: Find the longest path of equal-valued nodes in a binary tree encoded as a breadth-first list. Clarify the ambiguity with strict BST terminology, then compute both one-sided and through-node paths in linear time without unsafe recursion.

Loading…