上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 27 下一页
摘要: 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 ... 阅读全文
posted @ 2014-11-07 15:25 陆草纯 阅读(685) 评论(1) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2014-11-06 20:58 陆草纯 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 参考资料:openclassroom线性回归(Linear Regression)为了拟合10岁以下儿童年龄(x1)与身高(y)之间的关系,我们假设一个关于x的函数h(x):h(x) =Θ0+Θ1*x1 =Θ0*x0+Θ1*x1=ΘT*x(其中x0=1, x=[x0, x1])我们的目的是求出Θ,使... 阅读全文
posted @ 2014-11-06 13:35 陆草纯 阅读(776) 评论(0) 推荐(0) 编辑
摘要: Valid PalindromeGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a pla... 阅读全文
posted @ 2014-11-05 20:19 陆草纯 阅读(215) 评论(0) 推荐(0) 编辑
摘要: Search a 2D MatrixWrite an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row... 阅读全文
posted @ 2014-11-04 13:22 陆草纯 阅读(218) 评论(0) 推荐(0) 编辑
摘要: Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings.解法一:思路:设置一个位数记录器num,遍历所有字符串的第num位。如果都相同,则nu... 阅读全文
posted @ 2014-11-04 12:46 陆草纯 阅读(2474) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2014-10-31 15:52 陆草纯 阅读(569) 评论(0) 推荐(0) 编辑
摘要: 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.... 阅读全文
posted @ 2014-10-30 10:14 陆草纯 阅读(1853) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2014-10-15 15:56 陆草纯 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Pascal's TriangleGivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,... 阅读全文
posted @ 2014-10-12 22:07 陆草纯 阅读(3685) 评论(0) 推荐(1) 编辑
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 27 下一页