- 博客(181)
- 收藏
- 关注
转载 栈增长方向与大端/小端问题
转载地址:http://www.cnblogs.com/xkfz007/archive/2012/06/22/2558935.html
2014-08-20 20:28:02
576
转载 浅谈C/C++的浮点数在内存中的存储方式
原文地址: C/C++浮点数在内存中的存储方式 任何数据在内存中都是以二进制的形式存储的,例如一个short型数据1156,其二进制表示形式为00000100 10000100。则在Intel CPU架构的系统中,存放方式为 10000100(低地址单元) 00
2014-08-19 16:35:33
496
转载 Linux下二进制文件的查看和编辑
http://blog.youkuaiyun.com/hansel/article/details/5097262
2014-07-10 20:04:53
586
转载 SSH不输入密码连接远程Linux主机
原文地址:http://blog.chinaunix.net/uid-25266990-id-2600515.html
2014-06-26 14:57:05
503
转载 升级Ubuntu 12.04下的gcc到4.7
原文地址:http://blog.chinaunix.net/uid-23381466-id-3475968.html
2014-06-26 10:03:32
359
原创 LeetCode 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.
2014-06-07 15:01:49
308
原创 LeetCode 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
2014-06-07 10:55:14
320
原创 LeetCode Binary Tree Maximum Path Sum
题目:Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 / \ 2 3Ret
2014-06-04 22:16:46
375
原创 LeetCode 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
2014-06-04 20:49:14
344
原创 LeetCode 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 shoul
2014-06-04 16:52:15
354
原创 LeetCode Decode Ways
题目:A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determine the
2014-06-02 20:43:09
505
原创 LeetCode Valid Number
题目:Validate if a given string is numeric.Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => trueNote: It is intended for the problem statement to b
2014-06-02 17:27:42
508
原创 LeetCode Text Justification
题目:Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified.You should pack your words in a greedy approac
2014-06-02 11:54:29
431
原创 LeetCode Interleaving String
题目:Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac", return true.When s3 = "aadbbba
2014-06-01 15:43:43
444
原创 LeetCode Candy
题目:There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must have at
2014-06-01 10:57:40
423
原创 LeetCode Substring with Concatenation of All Words
题目:You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and w
2014-05-31 15:49:47
456
原创 LeetCode String to Integer (atoi)
题目:Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible
2014-05-29 22:16:16
469
转载 LeetCode Regular Expression Matching
题目:Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire
2014-05-29 21:20:56
527
原创 LeetCode 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
2014-05-29 17:15:30
448
原创 LeetCode Letter Combinations of a Phone Number
题目:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below.Input
2014-05-29 12:07:26
471
原创 LeetCode Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.方法1:使用最小堆,
2014-05-28 21:40:01
465
转载 priority_queue用法(转载)
关于priority_queue1,关于STL中的priority_queue:确定用top()查看顶部元素时,该元素是具有最高优先级的一个元素. 调用pop()删除之后,将促使下一个元素进入该位置. 2,如同stack和queue,priority_queue是一个基于基本序列容器进行构建的适配器,默认的序列器是vector. 模板原型:priority_queue
2014-05-28 21:21:10
545
原创 LeetCode Divide Two Integers
题目:Divide two integers without using multiplication, division and mod operator.
2014-05-28 18:02:34
467
原创 LeetCode Implement strStr()
题目:Implement strStr().Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.
2014-05-28 16:20:26
455
原创 LeetCode 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.
2014-05-28 15:18:28
438
原创 LeetCode Combination Sum II
题目:Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each number in C may only be used once in th
2014-05-28 11:34:06
261
原创 LeetCode Combination Sum
题目:Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen from C unlim
2014-05-28 10:17:52
339
原创 LeetCode 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
2014-05-27 22:20:01
292
原创 LeetCode 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].class
2014-05-27 21:38:04
296
原创 LeetCode Anagrams
题目:Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.
2014-05-27 21:12:27
266
原创 LeetCode N-Queens II
题目:Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.
2014-05-27 20:35:09
313
原创 LeetCode N-Queens
题目:The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.Given an integer n, return all distinct solutions to the n-queens
2014-05-27 20:27:47
311
原创 LeetCode 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]./** * Definition for an interval. * struc
2014-05-27 17:39:17
248
原创 LeetCode 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 ti
2014-05-27 16:38:20
302
原创 LeetCode 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""21
2014-05-27 10:46:51
406
原创 LeetCode Rotate List
题目:Given a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3->NULL.
2014-05-27 09:38:49
241
原创 LeetCode Simplify Path
题目:Given an absolute path for a file (Unix-style), simplify it.For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c"click to show corner cases.Corner Cases:
2014-05-26 22:13:04
274
原创 LeetCode Minimum Window Substring
题目:Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S = "ADOBECODEBANC"T = "ABC"Minimum windo
2014-05-26 20:58:19
319
原创 LeetCode Word Search
题目:Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or v
2014-05-26 16:28:47
274
原创 LeetCode Search in Rotated Sorted Array II
题目:Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?Write a function to determine if a given target
2014-05-24 17:03:12
269
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人