maximum-depth-of-binary-tree 1.0.0
Maximum Depth of Binary Tree
Loading...
Searching...
No Matches
main.cpp File Reference
#include <bits/stdc++.h>
Include dependency graph for main.cpp:

Go to the source code of this file.

Data Structures

struct  TreeNode
 
class  Solution
 

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 40 of file main.cpp.

41{
42 TreeNode* root = new TreeNode(1, nullptr, new TreeNode(2));
43 cout << "max depth: " << Solution().maxDepth(root) << '\n';
44 delete root->right;
45 delete root;
46 return 0;
47}
int maxDepth(TreeNode *root)
Definition main.cpp:18
TreeNode * right
Definition main.cpp:9

References Solution::maxDepth(), and TreeNode::right.