07 2015 档案
摘要:Different Ways to Add ParenthesesGiven a string of numbers and operators, return all possible results from computing all the different possible ways t...
阅读全文
摘要:Search a 2D Matrix IIWrite an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each ...
阅读全文
摘要:Sliding Window MaximumGiven an arraynums, there is a sliding window of sizekwhich is moving from the very left of the array to the very right. You can...
阅读全文
摘要:Product of Array Except SelfGiven an array ofnintegers wheren> 1,nums, return an arrayoutputsuch thatoutput[i]is equal to the product of all the eleme...
阅读全文
摘要:Delete Node in a Linked ListWrite a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the l...
阅读全文
摘要:一、开场白做机器学习的对这几个词应该比较熟悉了。最好是拿到全部数据,那就模型慢慢选,参数慢慢调,一轮一轮迭代,总能取得不错效果。但是面对新来数据,怎么能利用已经训练好的模型,把新的信息加进去?所以有很多人,包括我们组,一直想做好在线增量式学习。(1)来一波新数据,(2)抽信息更新模型,(3)扔掉那些...
阅读全文
摘要:Number of Digit OneGiven an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.For example:Gi...
阅读全文
摘要:Lowest Common Ancestor of a Binary TreeGiven a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to thedefin...
阅读全文
摘要:Basic Calculator IIImplement a basic calculator to evaluate a simple expression string.The expression string contains onlynon-negativeintegers,+,-,*,/...
阅读全文
摘要:Invert Binary TreeInvert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem w...
阅读全文
摘要:Implement Stack using QueuesImplement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the eleme...
阅读全文
摘要:Basic CalculatorImplement a basic calculator to evaluate a simple expression string.The expression string may contain open(and closing parentheses), t...
阅读全文
摘要:Lowest Common Ancestor of a Binary Search TreeGiven a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.Ac...
阅读全文
摘要:Rectangle AreaFind the total area covered by tworectilinearrectangles in a2Dplane.Each rectangle is defined by its bottom left corner and top right co...
阅读全文
摘要:Palindrome Linked ListGiven a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?解法一:一次遍历,装入vec...
阅读全文
摘要:Count Complete Tree NodesGiven acompletebinary tree, count the number of nodes.Definition of a complete binary tree fromWikipedia:In a complete binary...
阅读全文
摘要:Maximal SquareGiven a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the ...
阅读全文
摘要:Summary RangesGiven a sorted integer array without duplicates, return the summary of its ranges.For example, given[0,1,2,4,5,7], return["0->2","4->5",...
阅读全文
摘要:Majority Element IIGiven an integer array of sizen, find all elements that appear more than⌊ n/3 ⌋times. The algorithm should run in linear time and i...
阅读全文
摘要:Kth Smallest Element in a BSTGiven a binary search tree, write a functionkthSmallestto find thekth smallest element in it.Note:You may assume k is alw...
阅读全文
摘要:Power of TwoGiven an integer, write a function to determine if it is a power of two.Credits:Special thanks to@jianchao.li.fighterfor adding this probl...
阅读全文
摘要:Implement Queue using StacksImplement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes...
阅读全文
摘要:Contains Duplicate IIGiven an array of integers and an integerk, find out whether there there are two distinct indicesiandjin the array such thatnums[...
阅读全文
摘要:Contains DuplicateGiven an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at leas...
阅读全文
摘要:Combination Sum IIIFind all possible combinations ofknumbers that add up to a numbern, given that only numbers from 1 to 9 can be used and each combin...
阅读全文
摘要:Kth Largest Element in an ArrayFind thekth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the ...
阅读全文
摘要:Shortest PalindromeGiven a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest p...
阅读全文
摘要:House Robber IINote:This is an extension ofHouse Robber.After robbing those houses on that street, the thief has found himself a new place for his thi...
阅读全文
摘要:Add and Search Word - Data structure designDesign a data structure that supports the following two operations:void addWord(word)bool search(word)searc...
阅读全文
摘要:Course Schedule IIThere are a total ofncourses you have to take, labeled from0ton - 1.Some courses may have prerequisites, for example to take course ...
阅读全文