上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 22 下一页
摘要: There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every 阅读全文
posted @ 2016-08-06 21:59 YuriFLAG 阅读(200) 评论(0) 推荐(0)
摘要: We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wron 阅读全文
posted @ 2016-08-05 22:31 YuriFLAG 阅读(145) 评论(0) 推荐(0)
摘要: Given a target number, a non-negative integer k and an integer array A sorted in ascending order, find the k closest numbers to target in A, sorted in 阅读全文
posted @ 2016-07-31 10:55 YuriFLAG 阅读(505) 评论(0) 推荐(0)
摘要: Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example,Given n = 3, your program should 阅读全文
posted @ 2016-07-12 19:57 YuriFLAG 阅读(136) 评论(0) 推荐(0)
摘要: Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST's 阅读全文
posted @ 2016-07-12 17:23 YuriFLAG 阅读(126) 评论(0) 推荐(0)
摘要: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k then l 阅读全文
posted @ 2016-07-11 12:15 YuriFLAG 阅读(113) 评论(0) 推荐(0)
摘要: For an array A, if i < j, and A [i] > A [j], called (A [i], A [j]) is a reverse pair.return total of reverse pairs in A. For an array A, if i < j, and 阅读全文
posted @ 2016-07-10 12:19 YuriFLAG 阅读(201) 评论(0) 推荐(0)
摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). Find the minimum element. 阅读全文
posted @ 2016-07-09 09:39 YuriFLAG 阅读(129) 评论(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 @ 2016-07-08 20:03 YuriFLAG 阅读(115) 评论(0) 推荐(0)
摘要: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy 阅读全文
posted @ 2016-07-08 09:22 YuriFLAG 阅读(103) 评论(0) 推荐(0)
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 22 下一页