上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 50 下一页
摘要: Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST's 阅读全文
posted @ 2018-03-20 02:30 轻风舞动 阅读(806) 评论(0) 推荐(0) 编辑
摘要: If the depth of a tree is smaller than 5, then this tree can be represented by a list of three-digits integers. For each integer in this list: Given a 阅读全文
posted @ 2018-03-20 02:00 轻风舞动 阅读(699) 评论(0) 推荐(0) 编辑
摘要: You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a given value. The path does not need t 阅读全文
posted @ 2018-03-19 03:36 轻风舞动 阅读(514) 评论(0) 推荐(0) 编辑
摘要: 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 and sum 阅读全文
posted @ 2018-03-17 14:20 轻风舞动 阅读(350) 评论(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. F 阅读全文
posted @ 2018-03-17 13:22 轻风舞动 阅读(1014) 评论(0) 推荐(0) 编辑
摘要: Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where "adjac 阅读全文
posted @ 2018-03-17 07:51 轻风舞动 阅读(1435) 评论(0) 推荐(0) 编辑
摘要: Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set). Note: The solution set must not conta 阅读全文
posted @ 2018-03-17 07:36 轻风舞动 阅读(228) 评论(0) 推荐(0) 编辑
摘要: Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. For ex 阅读全文
posted @ 2018-03-17 07:30 轻风舞动 阅读(298) 评论(0) 推荐(0) 编辑
摘要: Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified. You shou 阅读全文
posted @ 2018-03-17 07:21 轻风舞动 阅读(473) 评论(0) 推荐(0) 编辑
摘要: Implement int sqrt(int x). Compute and return the square root of x. 求一个数的平方根。 解法:二分法,迭代循环在x范围内找中间值mid,然后判断mid * mid和x,如果mid > x/mid(不要写成middle*middle= 阅读全文
posted @ 2018-03-17 06:26 轻风舞动 阅读(1211) 评论(0) 推荐(0) 编辑
上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 50 下一页