05 2014 档案

摘要:Cookies are arbitrary pieces of data chosen by the web server and sent to the browser. The browser returns them unchanged to the server, introducing a... 阅读全文
posted @ 2014-05-22 23:57 linyx 阅读(430) 评论(0) 推荐(0)
摘要:版本HTTP/1.0这是第一个在通讯中指定版本号的HTTP协议版本,至今仍被广泛采用,特别是在代理服务器中。HTTP/1.1当前版本。持久连接被默认采用,并能很好地配合代理服务器工作。还支持以管道方式在同时发送多个请求,以便降低线路负载,提高传输速度。HTTP/1.1相较于HTTP/1.0协议的区别... 阅读全文
posted @ 2014-05-22 22:42 linyx 阅读(359) 评论(0) 推荐(0)
摘要:按Ctrl+A全选,之后再按Ctrl+Shift+F9,即可一次性全部删除超链接。 阅读全文
posted @ 2014-05-22 22:14 linyx 阅读(432) 评论(0) 推荐(0)
摘要:因特网协议栈Internet protocol stack:应用层Application layer、运输层Transport layer、网络层Network layer、链路层Data link layer、物理层Physical layer7层ISO OSI参考模型:应用层、表示层Presen... 阅读全文
posted @ 2014-05-21 23:18 linyx 阅读(286) 评论(0) 推荐(0)
摘要:Remove Duplicates from Sorted Array IGiven a sorted array, remove the duplicates in place such that each element appear only once and return the new l... 阅读全文
posted @ 2014-05-18 19:50 linyx 阅读(124) 评论(0) 推荐(0)
摘要:Search in Rotated Sorted Array ISuppose 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 ... 阅读全文
posted @ 2014-05-18 19:36 linyx 阅读(217) 评论(0) 推荐(0)
摘要:Jump Game IGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents ... 阅读全文
posted @ 2014-05-18 14:53 linyx 阅读(150) 评论(0) 推荐(0)
摘要:Combination Sum IGiven a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T... 阅读全文
posted @ 2014-05-18 11:28 linyx 阅读(162) 评论(0) 推荐(0)
摘要:Construct Binary Tree from Preorder and Inorder TraversalGiven preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume... 阅读全文
posted @ 2014-05-18 00:38 linyx 阅读(210) 评论(0) 推荐(0)
摘要: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.... 阅读全文
posted @ 2014-05-17 23:14 linyx 阅读(210) 评论(0) 推荐(0)
摘要: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 ... 阅读全文
posted @ 2014-05-17 21:45 linyx 阅读(136) 评论(0) 推荐(0)
摘要:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possibl... 阅读全文
posted @ 2014-05-17 19:37 linyx 阅读(215) 评论(0) 推荐(0)
摘要:Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique per... 阅读全文
posted @ 2014-05-17 16:11 linyx 阅读(168) 评论(0) 推荐(0)
摘要:Remove Duplicates from Sorted List IGiven a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->... 阅读全文
posted @ 2014-05-17 14:46 linyx 阅读(142) 评论(0) 推荐(0)
摘要:Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the o... 阅读全文
posted @ 2014-05-17 13:40 linyx 阅读(129) 评论(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 le... 阅读全文
posted @ 2014-05-17 13:18 linyx 阅读(130) 评论(0) 推荐(0)
摘要:Unique Binary Search Trees IGivenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a ... 阅读全文
posted @ 2014-05-16 15:25 linyx 阅读(150) 评论(0) 推荐(0)
摘要:Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n... 阅读全文
posted @ 2014-05-16 15:06 linyx 阅读(215) 评论(0) 推荐(0)
摘要:Given a linked list, remove the nth node from the end of list and return its head.For example,Given linked list: 1->2->3->4->5, and n = 2.After removi... 阅读全文
posted @ 2014-05-16 13:53 linyx 阅读(152) 评论(0) 推荐(0)
摘要:Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is ... 阅读全文
posted @ 2014-05-15 21:50 linyx 阅读(273) 评论(0) 推荐(0)
摘要:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo... 阅读全文
posted @ 2014-05-15 16:51 linyx 阅读(178) 评论(0) 推荐(0)
摘要: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 sho... 阅读全文
posted @ 2014-05-15 15:40 linyx 阅读(195) 评论(0) 推荐(0)
摘要: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 ... 阅读全文
posted @ 2014-05-15 15:13 linyx 阅读(177) 评论(0) 推荐(0)
摘要:Implement strStr().Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.此题我觉得并不是真要你写出kmp算法。 指针暴力... 阅读全文
posted @ 2014-05-14 21:31 linyx 阅读(228) 评论(0) 推荐(0)
摘要:Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.穷举很难。之前做Largest Rectangle in Hist... 阅读全文
posted @ 2014-05-14 17:27 linyx 阅读(176) 评论(0) 推荐(0)
摘要:Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the hist... 阅读全文
posted @ 2014-05-14 15:11 linyx 阅读(281) 评论(0) 推荐(0)
摘要:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longes... 阅读全文
posted @ 2014-05-13 12:06 linyx 阅读(160) 评论(0) 推荐(0)
摘要: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", retur... 阅读全文
posted @ 2014-05-12 22:06 linyx 阅读(161) 评论(0) 推荐(0)
摘要: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 = "ADOBECODE... 阅读全文
posted @ 2014-05-11 22:48 linyx 阅读(443) 评论(0) 推荐(0)
摘要: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 con... 阅读全文
posted @ 2014-05-11 20:08 linyx 阅读(185) 评论(0) 推荐(0)
摘要: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 concatena... 阅读全文
posted @ 2014-05-11 18:29 linyx 阅读(178) 评论(0) 推荐(0)
摘要: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 shoul... 阅读全文
posted @ 2014-05-11 01:19 linyx 阅读(177) 评论(0) 推荐(0)
摘要:A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any po... 阅读全文
posted @ 2014-05-10 21:02 linyx 阅读(150) 评论(0) 推荐(0)
摘要:Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-nega... 阅读全文
posted @ 2014-05-10 20:25 linyx 阅读(140) 评论(0) 推荐(0)
摘要:ktv如果唱这首应该很爽,慢慢学。红(くれない) 歌手:X JAPAN作词:YOSHIKI作曲:YOSHIKII could not look back you'd gone away from meI felt my heart ache I was afraid of following y... 阅读全文
posted @ 2014-05-10 16:25 linyx 阅读(315) 评论(0) 推荐(0)
摘要:Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t... 阅读全文
posted @ 2014-05-10 15:55 linyx 阅读(140) 评论(0) 推荐(0)
摘要:Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed from th... 阅读全文
posted @ 2014-05-10 15:03 linyx 阅读(161) 评论(0) 推荐(0)
摘要:Divide two integers without using multiplication, division and mod operator.这道题要AC也不容易,许多基础概念不懂。最后看了答案,自己再做也很难AC。还是要记住一些关键点才行:1. 负数的补码等于反码+1.所以负数取绝对值就... 阅读全文
posted @ 2014-05-10 02:17 linyx 阅读(179) 评论(0) 推荐(0)
摘要:32位平台char 1个字节8位short 2个字节16位int 4个字节32位long 4个字节long long 8个字节指针 4个字节64位平台char 1个字节short 2个字节int 4个字节long 8个字节long long 8个字节指针 8个字节范围char -128 ~ +127... 阅读全文
posted @ 2014-05-10 00:26 linyx 阅读(3457) 评论(0) 推荐(0)
摘要:Generate ParenthesesGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a... 阅读全文
posted @ 2014-05-09 15:08 linyx 阅读(245) 评论(0) 推荐(0)
摘要:N-Queens IThen-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no two queens attack each other.Given an integern, return a... 阅读全文
posted @ 2014-05-09 14:40 linyx 阅读(193) 评论(0) 推荐(0)
摘要:There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be ... 阅读全文
posted @ 2014-05-09 13:06 linyx 阅读(161) 评论(0) 推荐(0)
摘要:Path Sum IGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the gi... 阅读全文
posted @ 2014-05-09 10:37 linyx 阅读(137) 评论(0) 推荐(0)
摘要:Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of ... 阅读全文
posted @ 2014-05-08 18:33 linyx 阅读(207) 评论(0) 推荐(0)
摘要:O(g(n)) = { f(n) : 存在正常数c和n0 ,使对所有的n >= n0,都有 0 = n0,都有 0 = n0,都有 0 = n0,都有 0 = n0,都有 0 <= cg(n) <= f(n) }。小w记号给出函数的非渐进紧确的下界。 阅读全文
posted @ 2014-05-08 00:22 linyx 阅读(386) 评论(0) 推荐(0)
摘要:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu... 阅读全文
posted @ 2014-05-08 00:19 linyx 阅读(189) 评论(0) 推荐(0)
摘要:Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including th... 阅读全文
posted @ 2014-05-07 21:34 linyx 阅读(243) 评论(0) 推荐(0)
摘要:Regular Expression MatchingImplement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or mor... 阅读全文
posted @ 2014-05-07 15:00 linyx 阅读(213) 评论(0) 推荐(0)
摘要:Subsets IGiven a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set m... 阅读全文
posted @ 2014-05-07 00:26 linyx 阅读(218) 评论(0) 推荐(0)
摘要:Populating Next Right Pointers in Each Node IGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLin... 阅读全文
posted @ 2014-05-06 19:56 linyx 阅读(161) 评论(0) 推荐(0)
摘要:爱是恒久忍耐,又有恩慈;爱是不嫉妒,爱是不自夸,不张狂,不做害羞的事,不求自己的益处,不轻易发怒,不计算人的恶,不喜欢不义,只喜欢真理;凡事包容,凡事相信,凡事盼望,凡事忍耐。 阅读全文
posted @ 2014-05-06 18:31 linyx 阅读(290) 评论(0) 推荐(0)
摘要:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fol... 阅读全文
posted @ 2014-05-06 17:43 linyx 阅读(133) 评论(0) 推荐(0)
摘要:Best Time to Buy and Sell Stock ISay you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to ... 阅读全文
posted @ 2014-05-06 13:59 linyx 阅读(194) 评论(0) 推荐(0)
摘要: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 ... 阅读全文
posted @ 2014-05-05 22:53 linyx 阅读(215) 评论(0) 推荐(0)
摘要:Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, ... 阅读全文
posted @ 2014-05-05 20:13 linyx 阅读(138) 评论(0) 推荐(0)
摘要:Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initial... 阅读全文
posted @ 2014-05-05 11:16 linyx 阅读(208) 评论(0) 推荐(0)
摘要:Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have t... 阅读全文
posted @ 2014-05-04 23:21 linyx 阅读(136) 评论(0) 推荐(0)
摘要:Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:Only one letter ca... 阅读全文
posted @ 2014-05-04 13:54 linyx 阅读(610) 评论(0) 推荐(0)
摘要:平常在实验室上班,周末老板如果又给个邮件就让我一个周末也没了。这周决定白天一定要出去玩玩,不然宅在宿舍想着老板出的问题也过得太过悲催。昨晚刷完攻略后决定去赤柱。期待的是无敌海景还有沙滩比基尼。攻略上都说吃的贵,作为极品ds也就准备傍晚回来再吃。早上10点左右出发,到达中环再坐260去。坐大巴比坐地铁... 阅读全文
posted @ 2014-05-03 22:59 linyx 阅读(151) 评论(0) 推荐(0)
摘要:Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given [100, 4, 200, 1, 3, 2],The longest... 阅读全文
posted @ 2014-05-03 01:55 linyx 阅读(234) 评论(0) 推荐(0)
摘要:Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.想法很简单,就是两两合并。在Merge Two Sorted Lists这道题已经实现了两两合并的代码了,就... 阅读全文
posted @ 2014-05-02 21:33 linyx 阅读(196) 评论(0) 推荐(0)
摘要:Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which... 阅读全文
posted @ 2014-05-02 21:11 linyx 阅读(151) 评论(0) 推荐(0)
摘要:Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's in that surrounded ... 阅读全文
posted @ 2014-05-02 20:47 linyx 阅读(260) 评论(0) 推荐(0)
摘要:Log scale 1 %# some random data 2 x = 2.^(0:10); 3 y = rand(size(x)); 4 5 plot(log2(x), y) %# plot on log2 x-scale 6 se... 阅读全文
posted @ 2014-05-02 15:24 linyx 阅读(296) 评论(0) 推荐(0)
摘要:Valid PalindromeGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a pla... 阅读全文
posted @ 2014-05-02 15:18 linyx 阅读(266) 评论(0) 推荐(0)
摘要:Minimum Depth of Binary TreeGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root... 阅读全文
posted @ 2014-05-01 23:09 linyx 阅读(166) 评论(0) 推荐(0)
摘要:递归:就是出现这种情况的代码: (或者说是用到了栈)解答树角度:在dfs遍历一棵解答树 优点:结构简洁缺点:效率低,可能栈溢出递归的一般结构:1 void f() {2 if(符合边界条件) {3 ///////4 return;5 }6 7 ... 阅读全文
posted @ 2014-05-01 15:14 linyx 阅读(627) 评论(0) 推荐(0)
摘要:Determine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinki... 阅读全文
posted @ 2014-05-01 13:14 linyx 阅读(157) 评论(0) 推荐(0)
摘要:判断valid,没有更好的方法,只能brute force。 1 class Solution { 2 public: 3 bool isValidSudoku(vector > &board) { 4 5 int n; 6 for (int... 阅读全文
posted @ 2014-05-01 01:25 linyx 阅读(200) 评论(0) 推荐(0)