摘要: A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any point ... 阅读全文
posted @ 2015-05-27 08:48 爱刷题的小盒子 阅读(148) 评论(0) 推荐(0) 编辑
摘要: You 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 ways can you climb... 阅读全文
posted @ 2015-05-27 08:24 爱刷题的小盒子 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[−2,1,−3,4,−1,2,1,... 阅读全文
posted @ 2015-05-27 08:14 爱刷题的小盒子 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 96:Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's.1... 阅读全文
posted @ 2015-05-26 13:44 爱刷题的小盒子 阅读(1671) 评论(0) 推荐(0) 编辑
摘要: 2.6Given a circular linked list,implement an algorithm which returns the node at the beginning of the loop. 快指针和慢指针一起在头指针开始移动,快指针每次移动两步,慢指针每次移动一步,直到相遇... 阅读全文
posted @ 2015-05-10 14:09 爱刷题的小盒子 阅读(397) 评论(0) 推荐(0) 编辑
摘要: 2.5 You have two numbers represented by a linked list, where each node contains a single digit. The digits are stored in reverse order, such that the ... 阅读全文
posted @ 2015-05-10 11:59 爱刷题的小盒子 阅读(193) 评论(0) 推荐(0) 编辑