用constant来对column进行分层,以root为0,左边-1,右边+1。先把单个的node和column数值放进queue里,再一个一个poll出来,放进hashmap。最后从hashmap倒进list里面,return。
#314 Binary tree vertical order traversal
猜你喜欢
转载自www.cnblogs.com/yxcindy/p/9938760.html
今日推荐
周排行