方法一:使用非递归的方式,基于前序遍历的方法,与sametree方法的不同在于symmetric需要一个从做节点遍历,一个从右节点遍历 方法二:使用递归的方法,与sametree方法类似 Read More
posted @ 2017-04-15 11:30
chengcy
Views(116)
Comments(0)
Diggs(0)
方法一:使用递归的方法 方法二:使用非递归的方法,前序遍历一一比较 Read More
posted @ 2017-04-15 11:08
chengcy
Views(140)
Comments(0)
Diggs(0)
方法一:递归的方法,使用一个flag记录不同层次的遍历顺序,这里需要注意使用vector中insert操作 方法二:非递归方法,使用队列数据结构 Read More
posted @ 2017-04-15 10:42
chengcy
Views(103)
Comments(0)
Diggs(0)