2015年3月6日

Find Peak Element

摘要: Find Peak Element问题:A peak element is an element that is greater than its neighbors.Given an input array wherenum[i] ≠ num[i+1], find a peak element a... 阅读全文

posted @ 2015-03-06 21:49 zhouzhou0615 阅读(176) 评论(0) 推荐(0) 编辑

Unique Paths

摘要: Unique Paths问题: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 righ... 阅读全文

posted @ 2015-03-06 20:22 zhouzhou0615 阅读(136) 评论(0) 推荐(0) 编辑

Merge Two Sorted Lists

摘要: Merge Two Sorted Lists问题:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the ... 阅读全文

posted @ 2015-03-06 16:58 zhouzhou0615 阅读(104) 评论(0) 推荐(0) 编辑

Convert Sorted Array to Binary Search Tree

摘要: Convert Sorted Array to Binary Search Tree问题:Given an array where elements are sorted in ascending order, convert it to a height balanced BST.思路: 递归,... 阅读全文

posted @ 2015-03-06 16:45 zhouzhou0615 阅读(134) 评论(0) 推荐(0) 编辑

Climbing Stairs

摘要: Climbing Stairs问题: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 ... 阅读全文

posted @ 2015-03-06 16:18 zhouzhou0615 阅读(131) 评论(0) 推荐(0) 编辑

Majority Element

摘要: Majority Element 问题: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. Yo 阅读全文

posted @ 2015-03-06 16:09 zhouzhou0615 阅读(145) 评论(0) 推荐(0) 编辑

导航