12 2014 档案

摘要:Find Peak ElementA peak element is an element that is greater than its neighbors.Given an input array wherenum[i] ≠ num[i+1], find a peak element and ... 阅读全文
posted @ 2014-12-31 18:31 hechengzhu 阅读(108) 评论(0) 推荐(0)
摘要:Binary Tree Postorder TraversalGiven a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \... 阅读全文
posted @ 2014-12-30 19:40 hechengzhu 阅读(109) 评论(0) 推荐(0)
摘要:Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].Not... 阅读全文
posted @ 2014-12-30 19:31 hechengzhu 阅读(125) 评论(0) 推荐(0)
摘要:Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a... 阅读全文
posted @ 2014-12-30 19:10 hechengzhu 阅读(129) 评论(0) 推荐(0)
摘要:Majority ElementGiven an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may ass... 阅读全文
posted @ 2014-12-29 19:59 hechengzhu 阅读(120) 评论(1) 推荐(0)
摘要:Reverse Words in a StringGiven an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".click... 阅读全文
posted @ 2014-12-27 20:48 hechengzhu 阅读(116) 评论(1) 推荐(0)