摘要: Input: 5 Output: [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1] ]杨辉(帕斯卡)三角思想是每一行先create一个全是1的数组,然后填充看似不难,实际上都是细节,比如defensively copying,asList方法的使用,上一行的 阅读全文
posted @ 2019-03-08 13:12 Schwifty 阅读(113) 评论(0) 推荐(0)
摘要: Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and 阅读全文
posted @ 2019-03-08 11:12 Schwifty 阅读(140) 评论(0) 推荐(0)
摘要: Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For 阅读全文
posted @ 2019-03-08 01:33 Schwifty 阅读(103) 评论(0) 推荐(0)
摘要: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tree [3 阅读全文
posted @ 2019-03-08 01:32 Schwifty 阅读(117) 评论(0) 推荐(0)