2017年12月17日

Average of Levels in Binary Tree

摘要: Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. Example 1: 还是应用广度优先遍历(BFS),然后计算每一层的和就行 阅读全文

posted @ 2017-12-17 13:04 夜的第八章 阅读(123) 评论(0) 推荐(0) 编辑

Array Partition I

摘要: Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of 阅读全文

posted @ 2017-12-17 12:45 夜的第八章 阅读(113) 评论(0) 推荐(0) 编辑

导航