Find Elements in a Contaminated Binary Tree - Leetcode 1261 | Using DFS

preview_player
Показать описание
Given a binary tree with the following rules:

For any treeNode:

Implement the FindElements class:

FindElements(TreeNode* root) Initializes the object with a contaminated binary tree and recovers it.
bool find(int target) Returns true if the target value exists in the recovered binary tree.
Рекомендации по теме
visit shbcf.ru