摘要: Given a binary tree, return the preorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, return [1,2,3]. Note: Recursive solu 阅读全文
posted @ 2018-03-01 07:27 轻风舞动 阅读(425) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, return [1,3,2]. Note: Recursive solut 阅读全文
posted @ 2018-03-01 06:24 轻风舞动 阅读(1218) 评论(0) 推荐(0) 编辑
摘要: A message containing letters from A-Z is being encoded to numbers using the following mapping: Given a non-empty string containing only digits, determ 阅读全文
posted @ 2018-02-28 15:11 轻风舞动 阅读(548) 评论(0) 推荐(0) 编辑
摘要: You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins. Given n, find the total number 阅读全文
posted @ 2018-02-28 12:58 轻风舞动 阅读(350) 评论(0) 推荐(0) 编辑
摘要: Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target. E 阅读全文
posted @ 2018-02-28 09:41 轻风舞动 阅读(486) 评论(0) 推荐(0) 编辑
摘要: Design and implement a TwoSum class. It should support the following operations:add and find. add - Add the number to an internal data structure.find 阅读全文
posted @ 2018-02-28 09:24 轻风舞动 阅读(883) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function 阅读全文
posted @ 2018-02-28 09:11 轻风舞动 阅读(868) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex 阅读全文
posted @ 2018-02-28 08:51 轻风舞动 阅读(1030) 评论(0) 推荐(0) 编辑
摘要: The API: int read4(char *buf) reads 4 characters at a time from a file.The return value is the actual number of characters read. For example, it retur 阅读全文
posted @ 2018-02-28 08:40 轻风舞动 阅读(1243) 评论(0) 推荐(0) 编辑
摘要: The API: int read4(char *buf) reads 4 characters at a time from a file. The return value is the actual number of characters read. For example, it retu 阅读全文
posted @ 2018-02-28 08:35 轻风舞动 阅读(1963) 评论(0) 推荐(0) 编辑