上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 50 下一页
摘要: Given a non-empty array of integers, return the k most frequent elements. Example 1: Example 2: Input: nums = [1], k = 1 Output: [1] Example 2: Note: 阅读全文
posted @ 2018-03-30 03:49 轻风舞动 阅读(2784) 评论(0) 推荐(2) 编辑
摘要: There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For example, if A is a direct 阅读全文
posted @ 2018-03-29 08:50 轻风舞动 阅读(2238) 评论(0) 推荐(0) 编辑
摘要: Given a binary search tree and a node in it, find the in-order successor of that node in the BST. Note: If the given node has no in-order successor in 阅读全文
posted @ 2018-03-28 08:29 轻风舞动 阅读(650) 评论(0) 推荐(1) 编辑
摘要: Given a binary tree, return the vertical order traversal of its nodes' values. (ie, from top to bottom, column by column). If two nodes are in the sam 阅读全文
posted @ 2018-03-28 08:13 轻风舞动 阅读(1219) 评论(0) 推荐(0) 编辑
摘要: Given an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that support the peek() operation -- it e 阅读全文
posted @ 2018-03-28 07:15 轻风舞动 阅读(410) 评论(0) 推荐(0) 编辑
摘要: Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k num 阅读全文
posted @ 2018-03-28 06:08 轻风舞动 阅读(1323) 评论(0) 推荐(0) 编辑
摘要: Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in-place. Example 1: Example 2: Follow up: A straight forward solu 阅读全文
posted @ 2018-03-28 02:38 轻风舞动 阅读(521) 评论(0) 推荐(0) 编辑
摘要: According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John 阅读全文
posted @ 2018-03-28 02:19 轻风舞动 阅读(1027) 评论(0) 推荐(0) 编辑
摘要: Suppose you are at a party with n people (labeled from 0 to n - 1) and among them, there may exist one celebrity. The definition of a celebrity is tha 阅读全文
posted @ 2018-03-28 01:50 轻风舞动 阅读(1223) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path betwe 阅读全文
posted @ 2018-03-27 13:58 轻风舞动 阅读(2100) 评论(0) 推荐(0) 编辑
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 50 下一页