Skip to content

104. Maximum Depth of Binary Tree#23

Open
ryosuketc wants to merge 1 commit intomainfrom
104_maximum_depth_of_binary_tree
Open

104. Maximum Depth of Binary Tree#23
ryosuketc wants to merge 1 commit intomainfrom
104_maximum_depth_of_binary_tree

Conversation

@ryosuketc
Copy link
Owner

continue;
}
max_depth = std::max(max_depth, depth);
node_and_depth.push(std::make_pair(node->left, depth + 1));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

自分ならここで if (node->left) し、無駄な push() と pop() を省くのですが、趣味の範囲だと思います。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants