Microsoft Interview Question! | Count Good Nodes in Binary Tree - Leetcode 1448

preview_player
Показать описание
leetcode, coding interview question, data structures, data structures and algorithms, faang
Рекомендации по теме
Комментарии
Автор

Master Data Structures & Algorithms For FREE at AlgoMap.io!

GregHogg
Автор

Could be solved more elegantly by recursion, which is no surprise as this is equivalent to using a stack.

oferron
Автор

I would just recursive DFS and stop recursing when you hit a node > X

Rugg-qkpl
Автор

Just starting to learn this pattern, why don’t you pass in node.left.val and node.right.val in the stack append section

mokshcodes
visit shbcf.ru