2016年4月15日

Leetcode 226 Invert Binary Tree python

摘要: 题目: Invert a binary tree. 翻转二叉树。 递归,每次对节点的左右节点调用invertTree函数,直到叶节点。 python中也没有swap函数,当然你可以写一个,不过python中可以通过:a, b = b, a交换两个变量的值 阅读全文

posted @ 2016-04-15 23:33 def_sysu 阅读(349) 评论(0) 推荐(0)

Leetcode 104 Maximum Depth of Binary Tree python

摘要: 题目: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthe 阅读全文

posted @ 2016-04-15 22:42 def_sysu 阅读(295) 评论(0) 推荐(0)

导航