摘要:Binary search in sorted ArrayQuestion 1Median of Two Sorted ArraysThere are two sorted arraysnums1andnums2of size m and n respectively. Find the media...
阅读全文
07 2015 档案
摘要:Binary search in sorted ArrayQuestion 1Median of Two Sorted ArraysThere are two sorted arraysnums1andnums2of size m and n respectively. Find the media...
阅读全文
摘要:substringQuestion 1Implement strStr()Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part o...
阅读全文
摘要:Add / Divide / Multiply / Power / Plus / SqrtQuestion 1Add Two NumbersYou are given two linked lists representing two non-negative numbers. The digits...
阅读全文
摘要:n-sum problemQuestion 2Two SumGiven an array of integers, find two numbers such that they add up to a specific target number.The function twoSum shoul...
阅读全文
摘要:Question 1Add BinaryGiven two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".Firslty I wirte a very dire...
阅读全文
摘要:Question1Power of TwoGiven an integer, write a function to determine if it is a power of two.This question is pretty simple. If a number is a power of...
阅读全文
摘要:Question 1Reverse IntegerReverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321We need to consider a lot of cases of ...
阅读全文
摘要:Question 1Integer to RomanGiven an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999What we need to not...
阅读全文
摘要:Question 1Roman to IntegerGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.This problem is no...
阅读全文
摘要:Form today on, I changed to Math module question.Question 1String to Integer (atoi)Implementatoito convert a string to an integer.Remember one thing h...
阅读全文
摘要:Question 1.Convert Sorted Array to Binary Search TreeGiven an array where elements are sorted in ascending order, convert it to a height balanced BST....
阅读全文
摘要:Sum Root to Leaf NumbersGiven a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-l...
阅读全文
摘要:Path Sum IIGiven 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 tr...
阅读全文
摘要: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...
阅读全文
摘要:Balanced Binary TreeGiven a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tre...
阅读全文
摘要:Maximum Depth of Binary Tree (DFS, TREE)Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path fr...
阅读全文
|