|
| unordered_map< int, bool > | tree |
| |
Definition at line 15 of file main.cpp.
◆ FindElements()
| FindElements::FindElements |
( |
TreeNode * |
root | ) |
|
|
inline |
Definition at line 21 of file main.cpp.
22 {
23 if (!root)
24 return;
25 queue<pair<TreeNode*, int>> q;
26 q.push({root, 0});
27 while (!q.empty())
28 {
29 auto [node, current_val] = q.front();
30 q.pop();
31
32 tree[current_val] =
true;
33 if (node->left)
34 q.push({node->left, 2 * current_val + 1});
35 if (node->right)
36 q.push({node->right, 2 * current_val + 2});
37 }
38 }
unordered_map< int, bool > tree
References tree.
◆ find()
| bool FindElements::find |
( |
int |
target | ) |
|
|
inline |
◆ tree
| unordered_map<int, bool> FindElements::tree |
|
private |
The documentation for this class was generated from the following file: