上一页 1 ··· 5 6 7 8 9 10 11 12 13 下一页
摘要: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree andsum =... 阅读全文
posted @ 2014-11-12 22:20 Agentgamer 阅读(128) 评论(0) 推荐(0)
摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes... 阅读全文
posted @ 2014-11-12 13:43 Agentgamer 阅读(154) 评论(0) 推荐(0)
摘要: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo... 阅读全文
posted @ 2014-11-09 23:15 Agentgamer 阅读(127) 评论(0) 推荐(0)
摘要: Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your algorithm to use onlyO(... 阅读全文
posted @ 2014-11-09 21:56 Agentgamer 阅读(145) 评论(0) 推荐(0)
摘要: GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]... 阅读全文
posted @ 2014-11-09 21:08 Agentgamer 阅读(141) 评论(0) 推荐(0)
摘要: Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu... 阅读全文
posted @ 2014-11-09 20:20 Agentgamer 阅读(121) 评论(0) 推荐(0)
摘要: Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal... 阅读全文
posted @ 2014-11-09 18:00 Agentgamer 阅读(132) 评论(0) 推荐(0)
摘要: Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t... 阅读全文
posted @ 2014-11-09 14:52 Agentgamer 阅读(123) 评论(0) 推荐(0)
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana... 阅读全文
posted @ 2014-11-09 13:55 Agentgamer 阅读(116) 评论(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-11-07 08:53 Agentgamer 阅读(141) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 下一页