- 博客(66)
- 资源 (11)
- 收藏
- 关注
原创 060 - Permutation Sequence
The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order,We get the following sequence (ie, for n = 3):"123""132""213""231""312""
2015-11-27 08:36:20 328
原创 059 - Spiral Matrix II
Given an integer n, generate a square matrix filled with elements from 1 ton2 in spiral order.For example,Given n = 3,You should return the following matrix:[ [ 1, 2, 3 ], [ 8, 9, 4 ], [
2015-11-27 08:35:28 216
原创 058 - Length of Last Word
Given a string s consists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is defi
2015-11-27 08:34:09 258
原创 057 - Insert Interval
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start times.Examp
2015-11-27 08:33:13 239
原创 056 - Merge Intervals
Given a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18].int intercmp(const void *a, const void *b){
2015-11-27 08:31:36 220
原创 055 - Jump Game
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine if
2015-11-26 18:28:07 218
原创 054 - Spiral Matrix
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]You
2015-11-26 18:27:06 255
原创 053 - Maximum Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1,−5,4],the contiguous subarray [4,−1,2,1] has
2015-11-26 18:26:11 341
原创 052 - N-Queens II
Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.static int Q; static int retcur;int locok(char **queen, int cu
2015-11-26 18:24:51 307
原创 051 - N-Queens
The n-queens puzzle is the problem of placing n queens on ann×n chessboard such that no two queens attack each other.Given an integer n, return all distinct solutions to the n-queens puzzle.Ea
2015-11-26 18:23:44 366
原创 050 - Pow(x, n)
Implement pow(x, n).double myPow(double x, int n) { int flag = 0; if (n == 0) return fabs(x) < 0.000001? 0 : 1; if (n == INT_MIN) return fabs(x) >= 1.000000 && fabs(
2015-11-25 17:33:37 402
原创 049 - Group Anagrams
Given an array of strings, group anagrams together.For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return:[ ["ate", "eat","tea"], ["nat","tan"], ["bat"]]Note:For t
2015-11-25 17:32:37 404
原创 048 - Rotate Image
You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?void rotate(int** matrix, int matrixRowSize, int
2015-11-25 17:31:48 252
原创 047 - Permutations II
Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique permutations:[1,1,2], [1,2,1], and [2,1,1].
2015-11-25 17:30:52 250
原创 046 - Permutations
Given a collection of numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3], [2,3,1],[3,1,2], and [3,2,1].static int
2015-11-25 17:30:19 276
原创 045 - Jump Game II
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Your goal is
2015-11-25 17:29:02 238
原创 044 - Wildcard Matching
Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including the empty sequence).The matching should cover
2015-11-25 17:28:18 197
原创 043 - Multiply Strings
Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-negative.static void turnaround(char *str)
2015-11-25 17:26:44 343
原创 042 - Trapping Rain Water
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1,0,1,3,2,1,2,1]
2015-11-25 17:25:10 277
原创 041 - First Missing Positive
Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm should run in O(n) time and uses constant spa
2015-11-25 17:24:08 233
原创 修改内核代码-打补丁-checkpatch.pl
我们下载一份内核源码,修改了一些代码,需要制作补丁,用diff命令比如现在有两份内核源码 kernel-old, kernel-new打补丁,命令为diff -ruN kernel-old kernel-new > diff.patch可以通过Kompare,或者直接用gedit打开查看修改的代码接着要查看我们修改的代码是否符合内核编码规范就需要用到
2015-11-25 15:30:57 4884
原创 040 - Combination Sum II
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations inC where the candidate numbers sums to T.Each number in C may only be used once in the combinatio
2015-11-19 17:12:14 281
原创 039 - Combination Sum
Given a set of candidate numbers (C) and a target number (T), find all unique combinations inC where the candidate numbers sums to T.The same repeated number may be chosen from C unlimited numbe
2015-11-19 17:07:41 269
原创 038 - Count and Say
The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21 is read off as "one 2
2015-11-19 17:05:32 212
原创 037 - Sudoku Solver
Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character '.'.You may assume that there will be only one unique solution.A sudoku puzzle.
2015-11-19 17:02:38 282
原创 036 - Valid Sudoku
Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the character'.'.A partially filled s
2015-11-19 17:00:39 287
转载 O06 - proc
通过proc文件系统配置#include #include #include #include #include #include static unsigned int variable;static struct proc_dir_entry *test_dir, *test_entry;#if LINUX_VERSION_CODE < KERNEL_VERSI
2015-11-17 10:11:35 306
原创 指针之char** 与 char[][]的区别
char ** 和 char *[]是等价的char **x / char *x[] , 典型的例子是main函数的第二个参数可以写成char **argv, 也可以写成char *argv[]表示x是一个存储指针的数组,这个数组每个元素都是指针,在32系统上一个指针长度为4字节那么x[0] 和 x[1]之间相差4个字节x数组内存分布如下x[0], x[1], x[2], x[
2015-11-12 11:32:19 496
原创 035 - Search Insert Position
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.
2015-11-12 10:30:58 307
原创 034 - Search for a Range
Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the order of O(log n).If the target is not found in
2015-11-12 10:26:05 225
原创 033 - Search in Rotated Sorted Array
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).You are given a target value to search. If found in the array return its
2015-11-11 18:52:03 180
原创 032 - Longest Valid Parentheses
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring is "()", which
2015-11-11 18:45:47 226
原创 031 - Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible o
2015-11-11 18:43:31 302
原创 030 - Substring with Concatenation of All Words
You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) ins that is a concatenation of each word in words exactly once and w
2015-11-11 18:39:07 217
原创 029 - Divide Two Integers
Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.实现两个整数相除,不能使用乘,除,模运算int divide(int dividend, int divisor) { if (dividend =
2015-11-11 18:38:29 200
原创 028 - Implement strStr()
Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.int strStr(char* haystack, char* needle) { char *p = strstr(ha
2015-11-11 18:36:02 232
原创 027 - Remove Element
Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond the new length.
2015-11-11 18:33:54 184
原创 026 - Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear onlyonce and return the new length.Do not allocate extra space for another array, you must do this in place with
2015-11-11 18:32:31 216
原创 025 - Reverse Nodes in k-Group
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 left-out nodes in the end should remain as it is.
2015-11-11 18:30:23 200
原创 024 - Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. You m
2015-11-11 18:28:53 260
DM9000_Application_Notes_Ver_1_22.pdf
2015-12-08
core java 第八版代码
2015-02-14
core java 第七版代码
2015-02-14
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人