Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. Th...
分类:
其他好文 时间:
2015-08-09 00:21:20
阅读次数:
142
Given an array ofnintegers wheren> 1,nums, return an arrayoutputsuch thatoutput[i]is equal to the product of all the elements ofnumsexceptnums[i].Solv...
分类:
其他好文 时间:
2015-08-08 21:17:51
阅读次数:
128
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to thedefinition of LCA on Wikipedia: “The lowest ...
分类:
其他好文 时间:
2015-08-08 21:15:30
阅读次数:
110
Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is1 -> 2 -> 3 -> ...
分类:
其他好文 时间:
2015-08-08 21:12:33
阅读次数:
120
Given an arraynums, there is a sliding window of sizekwhich is moving from the very left of the array to the very right. You can only see theknumbers ...
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to thedefinition of LCA on Wikipedia: ...
分类:
其他好文 时间:
2015-08-08 19:42:01
阅读次数:
100
Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.For example:Given n = 13,Return 6...
分类:
其他好文 时间:
2015-08-08 18:04:05
阅读次数:
114
Given an integer, write a function to determine if it is a power of two.public class Solution { //注意0和负数都返回false!!! /*public boolean isP...
分类:
其他好文 时间:
2015-08-08 17:59:22
阅读次数:
149
Given a binary search tree, write a functionkthSmallestto find thekth smallest element in it.Note:You may assume k is always valid, 1 ≤ k ≤ BST's tota...
分类:
其他好文 时间:
2015-08-08 17:49:17
阅读次数:
121
Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in front o...
分类:
其他好文 时间:
2015-08-08 17:47:48
阅读次数:
134