上一页 1 2 3 4 5 6 ··· 13 下一页
摘要: Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. Subscribe to 阅读全文
posted @ 2016-01-31 18:03 sdlwlxf 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l 阅读全文
posted @ 2016-01-31 16:04 sdlwlxf 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowes 阅读全文
posted @ 2016-01-30 16:20 sdlwlxf 阅读(146) 评论(0) 推荐(0) 编辑
摘要: You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time 阅读全文
posted @ 2016-01-30 12:41 sdlwlxf 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST. Calling next() will return the n 阅读全文
posted @ 2016-01-28 22:32 sdlwlxf 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: 1 / \ 2 3 \ 5 All root-to-leaf paths are: ["1->2->5" 阅读全文
posted @ 2016-01-27 21:11 sdlwlxf 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Given a list of non negative integers, arrange them such that they form the largest number.For example, given[3, 30, 34, 5, 9], the largest formed num... 阅读全文
posted @ 2016-01-25 21:56 sdlwlxf 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".For C programmers: Try to solv... 阅读全文
posted @ 2016-01-22 21:09 sdlwlxf 阅读(213) 评论(0) 推荐(0) 编辑
摘要: Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.If the fractional part is repeating,... 阅读全文
posted @ 2016-01-22 20:05 sdlwlxf 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Compare two version numbersversion1andversion2.Ifversion1>version2return 1, ifversion1 a2) return 1; else if (a1 < a2) re... 阅读全文
posted @ 2016-01-19 21:17 sdlwlxf 阅读(175) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 13 下一页