【leetcode】222(Medium)Count Complete Tree Nodes

解题思路 可以用morris遍历,或者递归 提交代码:morris class Solution { public int countNodes(TreeNode root) { int res=0; TreeNode p1=root,p2=root; while(p1!=null) { if(p1.lef
相关文章
相关标签/搜索