程序媛詹妮弗
终身学习
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 30 下一页
摘要: Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window. For example, 题意: 给定固定长度的滑动窗口,更新滑动窗口中 阅读全文
posted @ 2018-06-16 02:36 程序媛詹妮弗 阅读(306) 评论(0) 推荐(0) 编辑
摘要: Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Example 1: Example 2: Follow up: A 阅读全文
posted @ 2018-06-13 02:58 程序媛詹妮弗 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the largest subtree which is a Binary Search Tree (BST), where largest means subtree with largest number of nodes in it. Not 阅读全文
posted @ 2018-06-13 02:52 程序媛詹妮弗 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, count the number of uni-value subtrees. A Uni-value subtree means all nodes of the subtree have the same value. Example : 题意: 给定一 阅读全文
posted @ 2018-06-12 07:57 程序媛詹妮弗 阅读(324) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. N 阅读全文
posted @ 2018-06-12 07:35 程序媛詹妮弗 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowes 阅读全文
posted @ 2018-06-09 09:48 程序媛詹妮弗 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. Note: A leaf is a node with no children. Exampl 阅读全文
posted @ 2018-06-09 09:22 程序媛詹妮弗 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Numbers can be regarded as product of its factors. For example, Write a function that takes an integer n and return all possible combinations of its f 阅读全文
posted @ 2018-06-09 05:08 程序媛詹妮弗 阅读(183) 评论(0) 推荐(0) 编辑
摘要: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 1 Input: 2 [ 3 1->4->5, 4 1->3->4, 5 2->6 6 ] 7 Out 阅读全文
posted @ 2018-06-09 04:28 程序媛詹妮弗 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Given a collection of intervals, merge all overlapping intervals. Example 1: 题意: 给定一些区间,将重叠部分合并。 思路: 将原interval集合里,给定区间按照start开头值的从小到大排序 建一个新的interval 阅读全文
posted @ 2018-06-09 03:25 程序媛詹妮弗 阅读(163) 评论(0) 推荐(0) 编辑
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 30 下一页