上一页 1 ··· 43 44 45 46 47 48 49 50 51 ··· 98 下一页
摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.C++代码实现:#include#include#include#includeu... 阅读全文
posted @ 2014-11-23 15:16 Jessica程序猿 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Given a collection of integers that might contain duplicates,S, return all possible subsets.Note:Elements in a subset must be in non-descending order.... 阅读全文
posted @ 2014-11-23 11:52 Jessica程序猿 阅读(185) 评论(1) 推荐(0) 编辑
摘要: Given a set of distinct integers,S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not co... 阅读全文
posted @ 2014-11-23 11:20 Jessica程序猿 阅读(168) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ... 阅读全文
posted @ 2014-11-23 08:56 Jessica程序猿 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Write a function to... 阅读全文
posted @ 2014-11-22 21:21 Jessica程序猿 阅读(151) 评论(0) 推荐(0) 编辑
摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).You are given a target value t... 阅读全文
posted @ 2014-11-22 21:09 Jessica程序猿 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Suppose a sort... 阅读全文
posted @ 2014-11-22 18:55 Jessica程序猿 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest le... 阅读全文
posted @ 2014-11-22 16:08 Jessica程序猿 阅读(188) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1].C+... 阅读全文
posted @ 2014-11-22 08:23 Jessica程序猿 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST.首先我是要AVL树的创建过程进行操作,不过提交之后出现超时,但还是让我将AVL树的创建过程实现了一遍,记录... 阅读全文
posted @ 2014-11-21 22:25 Jessica程序猿 阅读(229) 评论(0) 推荐(0) 编辑
上一页 1 ··· 43 44 45 46 47 48 49 50 51 ··· 98 下一页