上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 23 下一页
摘要: Given an integer array, heapify it into a min-heap array. Given [3,2,1,4,5], return [1,2,3,4,5] or any legal heap array. 阅读全文
posted @ 2016-03-22 13:07 哥布林工程师 阅读(170) 评论(0) 推荐(0) 编辑
摘要: The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total num 阅读全文
posted @ 2016-03-22 12:02 哥布林工程师 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Given n nodes labeled from 0 to n - 1 and a list ofundirected edges (each edge is a pair of nodes), write a function to check whether these edges make 阅读全文
posted @ 2016-03-22 11:44 哥布林工程师 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Given n = 3, a solution set is: "((()))", "(() 阅读全文
posted @ 2016-03-21 08:21 哥布林工程师 阅读(122) 评论(0) 推荐(0) 编辑
摘要: There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it cost 阅读全文
posted @ 2016-03-21 08:09 哥布林工程师 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted integer array, find the first missing positive integer. Given [1,2,0] return 3,and [3,4,-1,1] return 2. 思路: 通过在数组进行的交换,把A[i]赋值为i + 1 阅读全文
posted @ 2016-03-21 07:57 哥布林工程师 阅读(142) 评论(0) 推荐(0) 编辑
摘要: The code base version is an integer start from 1 to n. One day, someone committed a bad version in the code case, so it caused this version and the fo 阅读全文
posted @ 2016-03-21 07:23 哥布林工程师 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Given an array contains N numbers of 0 .. N, find which number doesn't exist in the array. Given N = 3 and the array [0, 1, 3], return 2. 阅读全文
posted @ 2016-03-21 07:20 哥布林工程师 阅读(122) 评论(0) 推荐(0) 编辑
摘要: There is an integer array which has the following features: We define a position P is a peek if: Find a peak element in this array. Return the index o 阅读全文
posted @ 2016-03-21 07:16 哥布林工程师 阅读(136) 评论(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-03-20 14:23 哥布林工程师 阅读(119) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 23 下一页