上一页 1 ··· 3 4 5 6 7 8 9 10 下一页
2018年12月3日
摘要: 1、快速排序 //快速排序 void quick_sort(int s[], int l, int r) { if (l < r) { //Swap(s[l], s[(l + r) / 2]); //将中间的这个数和第一个数交换 参见注1 int i = l, j = r, x = s[l]; wh 阅读全文
posted @ 2018-12-03 22:38 alau 阅读(157) 评论(0) 推荐(0) 编辑
2018年11月30日
摘要: 【题目】 Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate 阅读全文
posted @ 2018-11-30 22:27 alau 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 【题目】 Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where 阅读全文
posted @ 2018-11-30 22:10 alau 阅读(148) 评论(0) 推荐(0) 编辑
2018年11月28日
摘要: 【题目】 Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2. You have the following 3 operations pe 阅读全文
posted @ 2018-11-28 22:57 alau 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 【题目】 There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of th 阅读全文
posted @ 2018-11-28 14:15 alau 阅读(131) 评论(0) 推荐(0) 编辑
2018年11月26日
摘要: 【题目】 Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination shoul 阅读全文
posted @ 2018-11-26 20:22 alau 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 【题目1】 Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in t 阅读全文
posted @ 2018-11-26 20:00 alau 阅读(119) 评论(0) 推荐(0) 编辑
2018年11月20日
摘要: leetcode 34 最早出现和最后出现 class Solution { public int[] searchRange(int[] nums, int target) { int []ans={-1,-1} ; for(int i=0;i<nums.length;i++){ if(nums[ 阅读全文
posted @ 2018-11-20 13:40 alau 阅读(106) 评论(0) 推荐(0) 编辑
2018年11月19日
摘要: 【题目】 每一行、每一列、每个3*3的格子里只能出现一次1~9。 【思路】 参考了思路,附加了解释。 dfs遍历所有非空格子,n是已经填好的个数。 初始化条件。n=81,都填了,返回结束。对于已经填好的b[x][y] != '.'跳过,到下一个。 xy的设计保证先行后列填写。 开始填数字,valid 阅读全文
posted @ 2018-11-19 16:29 alau 阅读(169) 评论(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 阅读全文
posted @ 2018-11-19 15:46 alau 阅读(239) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 下一页