方法一:基于递归的方式 方法二:使用递归的方式 Maximum depth of binary tree方法和minimum相同 方法一:递归 方法二:迭代: Read More
posted @ 2017-04-17 21:39 chengcy Views(174) Comments(0) Diggs(0)
方法一:最简单的方法是将列表中的数字存储在vector中,那么方法同上 方法二:基于列表遍历的方式,这里需要注意当遍历右子树时,lt=0而不是mid+1; Read More
posted @ 2017-04-17 20:42 chengcy Views(116) Comments(0) Diggs(0)
方法:使用递归的方式 Read More
posted @ 2017-04-17 19:43 chengcy Views(110) Comments(0) Diggs(0)