05 2015 档案

【Maximum Subarray 】cpp
摘要:题目: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... 阅读全文

posted @ 2015-05-30 17:29 承续缘 阅读(183) 评论(0) 推荐(0) 编辑

【Triangle 】cpp
摘要:题目: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 ... 阅读全文

posted @ 2015-05-30 16:09 承续缘 阅读(274) 评论(0) 推荐(0) 编辑

【Container With Most Water】cpp
摘要:题目:Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints ... 阅读全文

posted @ 2015-05-30 15:22 承续缘 阅读(129) 评论(0) 推荐(0) 编辑

【Longest Substring Without Repeating Characters】cpp
摘要:题目:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters... 阅读全文

posted @ 2015-05-30 15:11 承续缘 阅读(154) 评论(0) 推荐(0) 编辑

【Best Time to Buy and Sell Stock II】cpp
摘要:题目:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complet... 阅读全文

posted @ 2015-05-30 09:19 承续缘 阅读(191) 评论(0) 推荐(0) 编辑

【Best Time to Buy and Sell Stock】cpp
摘要:题目:Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction ... 阅读全文

posted @ 2015-05-30 08:59 承续缘 阅读(133) 评论(0) 推荐(0) 编辑

【Jump Game II 】cpp
摘要:题目: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 max... 阅读全文

posted @ 2015-05-29 21:35 承续缘 阅读(199) 评论(0) 推荐(0) 编辑

【Jump Game】cpp
摘要:题目: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 max... 阅读全文

posted @ 2015-05-29 19:50 承续缘 阅读(220) 评论(0) 推荐(0) 编辑

【 Sqrt(x) 】cpp
摘要:题目:Implementint sqrt(int x).Compute and return the square root ofx.代码:class Solution {public: int mySqrt(int x) { if (x mid )... 阅读全文

posted @ 2015-05-29 15:16 承续缘 阅读(452) 评论(0) 推荐(0) 编辑

【Pow(x,n)】
摘要:题目:Implement pow(x,n).代码:class Solution {public: double myPow(double x, int n) { double ret = Solution::positivePow(fabs(x), ... 阅读全文

posted @ 2015-05-29 11:23 承续缘 阅读(328) 评论(0) 推荐(0) 编辑

【Word Search】cpp
摘要:题目: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 "adj... 阅读全文

posted @ 2015-05-29 11:17 承续缘 阅读(208) 评论(0) 推荐(0) 编辑

【Sudoku Solver】cpp
摘要:题目: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... 阅读全文

posted @ 2015-05-28 21:46 承续缘 阅读(170) 评论(0) 推荐(0) 编辑

【Generate Parentheses】cpp
摘要:题目:Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"(((... 阅读全文

posted @ 2015-05-28 16:17 承续缘 阅读(168) 评论(0) 推荐(0) 编辑

【Combination Sum II 】cpp
摘要:题目:Given a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Each numb... 阅读全文

posted @ 2015-05-28 15:27 承续缘 阅读(184) 评论(0) 推荐(0) 编辑

【Combination Sum 】cpp
摘要:题目:Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepeated ... 阅读全文

posted @ 2015-05-28 14:47 承续缘 阅读(248) 评论(0) 推荐(0) 编辑

【Restore IP Addresses 】cpp
摘要:题目:Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given"25525511135",return["25... 阅读全文

posted @ 2015-05-28 08:48 承续缘 阅读(240) 评论(0) 推荐(0) 编辑

【N-Quens II】cpp
摘要:题目:Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.代码:class Solution {publi... 阅读全文

posted @ 2015-05-27 11:58 承续缘 阅读(287) 评论(0) 推荐(0) 编辑

【N-Queens】cpp
摘要:题目:Then-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no two queens attack each other.Given an integern, return all dist... 阅读全文

posted @ 2015-05-27 11:22 承续缘 阅读(220) 评论(0) 推荐(0) 编辑

【Unique Paths II】cpp
摘要:题目:Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty spac... 阅读全文

posted @ 2015-05-27 09:01 承续缘 阅读(191) 评论(0) 推荐(0) 编辑

【Unique Paths】cpp
摘要:题目:A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any poi... 阅读全文

posted @ 2015-05-26 16:39 承续缘 阅读(199) 评论(0) 推荐(0) 编辑

【Palindrome Partitioning】cpp
摘要:题目:Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioning ofs.For example, ... 阅读全文

posted @ 2015-05-26 15:41 承续缘 阅读(181) 评论(0) 推荐(0) 编辑

【Surrounded Regions】cpp
摘要:题目: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 reg... 阅读全文

posted @ 2015-05-26 11:06 承续缘 阅读(244) 评论(0) 推荐(0) 编辑

【Word Ladder II】cpp
摘要:题目:Given two words (startandend), and a dictionary, find all shortest transformation sequence(s) fromstarttoend, such that:Only one letter can be chan... 阅读全文

posted @ 2015-05-25 15:29 承续缘 阅读(224) 评论(0) 推荐(0) 编辑

【word ladder】cpp
摘要:题目:Given two words (beginWordandendWord), and a dictionary, find the length of shortest transformation sequence frombeginWordtoendWord, such that:Only... 阅读全文

posted @ 2015-05-25 10:47 承续缘 阅读(169) 评论(0) 推荐(0) 编辑

【Letter Combinations of a Phone Number】cpp
摘要:题目:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telep... 阅读全文

posted @ 2015-05-22 13:58 承续缘 阅读(221) 评论(0) 推荐(0) 编辑

【Combinations】cpp
摘要:题目:Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution is:[ [2,4], [3,4], [2,... 阅读全文

posted @ 2015-05-21 20:46 承续缘 阅读(190) 评论(0) 推荐(0) 编辑

【Permutations II】cpp
摘要:题目:Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2]have the following unique p... 阅读全文

posted @ 2015-05-21 16:04 承续缘 阅读(205) 评论(0) 推荐(0) 编辑

【Permutations】cpp
摘要:题目: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],... 阅读全文

posted @ 2015-05-21 10:47 承续缘 阅读(305) 评论(0) 推荐(0) 编辑

【Subsets II】cpp
摘要:题目:Given a collection of integers that might contain duplicates,nums, return all possible subsets.Note:Elements in a subset must be in non-descending ... 阅读全文

posted @ 2015-05-20 22:01 承续缘 阅读(256) 评论(0) 推荐(0) 编辑

【Subsets】cpp
摘要:题目:Given a set of distinct integers,nums, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must ... 阅读全文

posted @ 2015-05-20 11:49 承续缘 阅读(239) 评论(0) 推荐(0) 编辑

【Search a 2D Matrix】cpp
摘要:题目:Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted fro... 阅读全文

posted @ 2015-05-19 16:47 承续缘 阅读(182) 评论(0) 推荐(0) 编辑

【Search Insert Position 】cpp
摘要:题目: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... 阅读全文

posted @ 2015-05-19 16:22 承续缘 阅读(147) 评论(0) 推荐(0) 编辑

【Search for a Range】cpp
摘要:题目: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 ... 阅读全文

posted @ 2015-05-19 15:28 承续缘 阅读(171) 评论(0) 推荐(0) 编辑

【Sort Colors】cpp
摘要:题目:Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red,... 阅读全文

posted @ 2015-05-19 11:01 承续缘 阅读(200) 评论(0) 推荐(0) 编辑

【First Missing Positive】cpp
摘要:题目:Given an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Your algorithm should... 阅读全文

posted @ 2015-05-19 08:33 承续缘 阅读(173) 评论(0) 推荐(0) 编辑

【Sort List】cpp
摘要:题目:Sort a linked list inO(nlogn) time using constant space complexity.代码:/** * Definition for singly-linked list. * struct ListNode { * int val; *... 阅读全文

posted @ 2015-05-18 20:36 承续缘 阅读(287) 评论(0) 推荐(0) 编辑

【Insertion Sorted List】cpp
摘要:题目:Sort a linked list using insertion sort.代码:/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ... 阅读全文

posted @ 2015-05-18 20:00 承续缘 阅读(140) 评论(0) 推荐(0) 编辑

【Merge K Sorted Lists】cpp
摘要:题目:Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.代码:/** * Definition for singly-linked list. * struc... 阅读全文

posted @ 2015-05-18 19:21 承续缘 阅读(168) 评论(0) 推荐(0) 编辑

【Merge Two Sorted Lists】cpp
摘要:题目:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.代码:/**... 阅读全文

posted @ 2015-05-18 14:50 承续缘 阅读(126) 评论(0) 推荐(0) 编辑

【Merge Sorted Array】cpp
摘要:题目:Given two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:You may assume thatnums1has enough space (size that is gr... 阅读全文

posted @ 2015-05-18 14:40 承续缘 阅读(208) 评论(0) 推荐(0) 编辑

【Sum Root to Leaf Numbers】cpp
摘要:题目:Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which ... 阅读全文

posted @ 2015-05-18 11:23 承续缘 阅读(225) 评论(0) 推荐(0) 编辑

【Binary Tree Maximum Path Sum】cpp
摘要:题目: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 @ 2015-05-18 10:29 承续缘 阅读(159) 评论(0) 推荐(0) 编辑

【Path Sum II】cpp
摘要:题目:Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree andsu... 阅读全文

posted @ 2015-05-17 22:19 承续缘 阅读(284) 评论(0) 推荐(0) 编辑

【Path Sum】cpp
摘要:题目:Given 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 given sum... 阅读全文

posted @ 2015-05-16 23:57 承续缘 阅读(287) 评论(0) 推荐(0) 编辑

【Maximum Depth of Binary Tree 】cpp
摘要:题目:Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest... 阅读全文

posted @ 2015-05-16 23:09 承续缘 阅读(144) 评论(0) 推荐(0) 编辑

【Minimum Depth of Binary Tree】cpp
摘要:题目:Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest... 阅读全文

posted @ 2015-05-16 21:53 承续缘 阅读(193) 评论(0) 推荐(0) 编辑

【Convert Sorted List to Binary Search Tree】cpp
摘要:题目:Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.代码:/** * Definition for singly-linked ... 阅读全文

posted @ 2015-05-16 21:23 承续缘 阅读(160) 评论(0) 推荐(0) 编辑

【Convert Sorted Array to Binary Search Tree】cpp
摘要:题目:Given an array where elements are sorted in ascending order, convert it to a height balanced BST.代码:/** * Definition for a binary tree node. * stru... 阅读全文

posted @ 2015-05-16 20:13 承续缘 阅读(194) 评论(0) 推荐(0) 编辑

【Validate Binary Search Tree】cpp
摘要:题目: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 onl... 阅读全文

posted @ 2015-05-16 18:15 承续缘 阅读(197) 评论(0) 推荐(0) 编辑

【Unique Binary Search Trees II】cpp
摘要:题目:Givenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n.For example,Givenn= 3, your program should return all 5 ... 阅读全文

posted @ 2015-05-16 16:56 承续缘 阅读(214) 评论(0) 推荐(0) 编辑

【Unique Binary Search Trees】cpp
摘要:题目:Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's. ... 阅读全文

posted @ 2015-05-16 15:38 承续缘 阅读(222) 评论(0) 推荐(0) 编辑

【Construct Binary Tree from Inorder and Postorder Traversal】cpp
摘要:题目:Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.代码:/** * De... 阅读全文

posted @ 2015-05-16 11:43 承续缘 阅读(153) 评论(0) 推荐(0) 编辑

【Construct Binary Tree from Preorder and Inorder Traversal】cpp
摘要:题目:Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.代码:/** * Def... 阅读全文

posted @ 2015-05-16 11:14 承续缘 阅读(144) 评论(0) 推荐(0) 编辑

【Populating Next Right Pointers in Each Node II】cpp
摘要:题目:Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution s... 阅读全文

posted @ 2015-05-15 11:41 承续缘 阅读(160) 评论(0) 推荐(0) 编辑

【Flatten Binary Tree to Linked List】cpp
摘要:题目:Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattene... 阅读全文

posted @ 2015-05-15 09:54 承续缘 阅读(195) 评论(0) 推荐(0) 编辑

【Symmetric Tree】cpp
摘要:题目:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / ... 阅读全文

posted @ 2015-05-15 09:32 承续缘 阅读(209) 评论(0) 推荐(0) 编辑

【Same Tree】cpp
摘要:题目:Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical... 阅读全文

posted @ 2015-05-15 08:39 承续缘 阅读(279) 评论(0) 推荐(0) 编辑

【Recover Binary Search Tree】cpp
摘要:题目: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 ... 阅读全文

posted @ 2015-05-14 22:34 承续缘 阅读(269) 评论(0) 推荐(0) 编辑

【Binary Tree Zigzag Level Order Traversal】cpp
摘要:题目:Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next level and... 阅读全文

posted @ 2015-05-14 11:17 承续缘 阅读(165) 评论(0) 推荐(0) 编辑

【Binary Tree Level Order Traversal II 】cpp
摘要:题目:Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For ... 阅读全文

posted @ 2015-05-14 10:18 承续缘 阅读(143) 评论(0) 推荐(0) 编辑

【Binary Tree Level Order Traversal】cpp
摘要:题目:Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree{3,... 阅读全文

posted @ 2015-05-14 09:59 承续缘 阅读(212) 评论(0) 推荐(0) 编辑

【Binary Tree Post order Traversal】cpp
摘要:题目:Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1]... 阅读全文

posted @ 2015-05-13 22:57 承续缘 阅读(291) 评论(0) 推荐(0) 编辑

【Binary Tree Inorder Traversal】cpp
摘要:题目:Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,3,2].N... 阅读全文

posted @ 2015-05-13 20:56 承续缘 阅读(249) 评论(0) 推荐(0) 编辑

【Binary Tree Preorder Traversal】cpp
摘要:题目:Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].... 阅读全文

posted @ 2015-05-13 20:00 承续缘 阅读(142) 评论(0) 推荐(0) 编辑

二叉树
摘要:刷题进入到二叉树这个章节,开篇随笔记录下二叉树相关的内容:二叉树的各种遍历和操作:http://blog.csdn.net/fansongy/article/details/6798278二叉搜索树(BST)的插入、查找、删除:http://segmentfault.com/a/1190000002... 阅读全文

posted @ 2015-05-13 19:32 承续缘 阅读(128) 评论(0) 推荐(0) 编辑

【Evaluate Reverse Polish Notation】cpp
摘要:题目:Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another expr... 阅读全文

posted @ 2015-05-13 14:46 承续缘 阅读(118) 评论(0) 推荐(0) 编辑

【Largest Rectangle in Histogram】cpp
摘要:题目:Givennnon-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the his... 阅读全文

posted @ 2015-05-13 09:42 承续缘 阅读(323) 评论(0) 推荐(0) 编辑

【Longest Valid Parentheses】cpp
摘要:题目:Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the long... 阅读全文

posted @ 2015-05-12 18:49 承续缘 阅读(137) 评论(0) 推荐(0) 编辑

【Valid Parentheses】cpp
摘要:题目:Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the corre... 阅读全文

posted @ 2015-05-12 15:20 承续缘 阅读(139) 评论(0) 推荐(0) 编辑

【Length of Last Word】cpp
摘要:题目:Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word ... 阅读全文

posted @ 2015-05-11 23:07 承续缘 阅读(242) 评论(0) 推荐(0) 编辑

【Simplify Path】cpp
摘要:题目: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 ... 阅读全文

posted @ 2015-05-11 21:38 承续缘 阅读(154) 评论(0) 推荐(0) 编辑

【Anagrams】 cpp
摘要:题目:Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.代码:class Solution {public: vect... 阅读全文

posted @ 2015-05-11 19:47 承续缘 阅读(177) 评论(0) 推荐(0) 编辑

【Count and Say】cpp
摘要:题目:The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read off as... 阅读全文

posted @ 2015-05-11 19:00 承续缘 阅读(206) 评论(0) 推荐(0) 编辑

【Roman To Integer】cpp
摘要:题目:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.代码:class Solution {public: int romanTo... 阅读全文

posted @ 2015-05-11 16:02 承续缘 阅读(142) 评论(0) 推荐(0) 编辑

【Integer To Roman】cpp
摘要:题目:Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.代码:class Solution {public: string intT... 阅读全文

posted @ 2015-05-11 15:26 承续缘 阅读(177) 评论(0) 推荐(0) 编辑

【Valid Number】cpp
摘要:题目: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 s... 阅读全文

posted @ 2015-05-11 11:48 承续缘 阅读(243) 评论(0) 推荐(0) 编辑

【Longest Common Prefix】cpp
摘要:题目:Write a function to find the longest common prefix string amongst an array of strings.代码:class Solution {public: string longestCommonPrefix(vect... 阅读全文

posted @ 2015-05-10 18:22 承续缘 阅读(183) 评论(0) 推荐(0) 编辑

【WildCard Matching】cpp
摘要:题目:Implement wildcard pattern matching with support for'?'and'*'.'?' Matches any single character.'*' Matches any sequence of characters (including th... 阅读全文

posted @ 2015-05-08 09:53 承续缘 阅读(274) 评论(0) 推荐(0) 编辑

【 Regular Expression Matching 】cpp
摘要:题目:Implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.... 阅读全文

posted @ 2015-05-07 11:17 承续缘 阅读(223) 评论(0) 推荐(0) 编辑

【Longest Palindromic Substring】cpp
摘要:题目:Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest... 阅读全文

posted @ 2015-05-06 16:03 承续缘 阅读(204) 评论(0) 推荐(0) 编辑

【Add binary】cpp
摘要:题目:Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".代码:class Solution {public: string addBina... 阅读全文

posted @ 2015-05-06 10:05 承续缘 阅读(204) 评论(0) 推荐(0) 编辑

【String to Integer (atoi) 】cpp
摘要:题目:Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below a... 阅读全文

posted @ 2015-05-05 20:31 承续缘 阅读(349) 评论(0) 推荐(0) 编辑

【Implement strStr() 】cpp
摘要:题目:Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Update (2014-11-02):The... 阅读全文

posted @ 2015-05-03 22:30 承续缘 阅读(235) 评论(0) 推荐(0) 编辑

【Valid Palindrome】cpp
摘要:题目:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: P... 阅读全文

posted @ 2015-05-03 22:24 承续缘 阅读(173) 评论(0) 推荐(0) 编辑

【LRU Cache】cpp
摘要:题目:Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get the v... 阅读全文

posted @ 2015-05-01 21:57 承续缘 阅读(233) 评论(0) 推荐(0) 编辑

【Reorder List】cpp
摘要:题目:Given a singly linked listL:L0→L1→…→Ln-1→Ln,reorder it to:L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For e... 阅读全文

posted @ 2015-05-01 09:42 承续缘 阅读(173) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示