Adobe Coding Interview Question - Height of Binary Tree - Leetcode 104

preview_player
Показать описание
Adobe Coding Interview Question - Height of Binary Tree - Leetcode 104
Рекомендации по теме
Комментарии
Автор

i interviewed at adobe just a month or two ago and they definitely gave me the hardest questions i’ve had

ghgftyy
Автор

You can actually pick a node 'a' arbitrary then find the farthest node 'b' from it(dfs), now find the farthest node form 'b', the distance between 'b' and that node is the answer

OvercookedOmlette
Автор

but that uses O(log(n)) memory; obviously you can use O(1) memory instead

simonwillover
visit shbcf.ru