摘要:
Find Minimum in Rotated Sorted ArraySuppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 ... 阅读全文
摘要:
Remove Nth Node From End of ListGiven a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2... 阅读全文
摘要:
Valid PalindromeGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a pla... 阅读全文
摘要:
Search a 2D MatrixWrite an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row... 阅读全文
摘要:
Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings.解法一:思路:设置一个位数记录器num,遍历所有字符串的第num位。如果都相同,则nu... 阅读全文
摘要:
Reorder ListGiven 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' val... 阅读全文
摘要:
Convert Sorted List to Binary Search TreeGiven a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.... 阅读全文
摘要:
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 distinct way... 阅读全文