08 2015 档案
摘要:STL 容器顺序容器vector 内存连续,两倍增长deque 内存小片连续,链表相连。 双端队列。list 内存不连续。 双向链表。关联容器map 红黑树实现set 红黑树实现容器适配器queue 队列。先入先出 在deque基础上封装;stack 栈。 先进后出 在deque基础上封装;prio...
阅读全文
摘要:leetcode -Convert Sorted Array to Binary Search TreeGiven an array where elements are sorted in ascending order, convert it to a height balanced BST./...
阅读全文
摘要:leetcode -Valid AnagramGiven two stringssandt, write a function to determine iftis an anagram ofs.For example,s= "anagram",t= "nagaram", return true.s...
阅读全文
摘要:leetcode -Invert Binary Treenvert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1/** * Defini...
阅读全文
摘要:leetcode - Lowest Common Ancestor of a Binary Search TreeGiven a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in...
阅读全文
摘要:leetcode -Minimum Path SumGiven amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numb...
阅读全文
摘要:leetcode -Unique PathsA robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down ...
阅读全文
摘要:leetcode -Climbing StairsYou are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many di...
阅读全文
摘要:leetcode - Maximum SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given ...
阅读全文
摘要:leetcode -Unique Binary Search TreesGivenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, ther...
阅读全文
摘要:leetcode -Best Time to Buy and Sell Stock IIISay you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm t...
阅读全文
摘要:leetcode -Best Time to Buy and Sell StockSay you have an array for which theithelement is the price of a given stock on dayi.If you were only permitte...
阅读全文
摘要:leetcode -Best Time to Buy and Sell Stock IISay you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to...
阅读全文
摘要:leetcode -Same TreeGiven two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are struct...
阅读全文
摘要:leetcode -Minimum Depth of Binary TreeGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path fro...
阅读全文
摘要:leetcode -Maximum Depth of Binary TreeGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from...
阅读全文
摘要:leetcode -Single Number IIGiven an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm should ...
阅读全文
摘要:leetcode -Single NumberGiven an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a li...
阅读全文
摘要:Given a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example:Givennum = 38, the process is like:3 + ...
阅读全文
摘要:leetcode - Valid ParenthesesGiven a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The bracket...
阅读全文
摘要:leetcode -Longest Palindromic SubstringGiven a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000,...
阅读全文
摘要:leetcode - String to Integer (atoi)Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a chal...
阅读全文
摘要:leetcode -Reverse Words in a StringGiven an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky ...
阅读全文

浙公网安备 33010602011771号