![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
刷题
huilaner
这个作者很懒,什么都没留下…
展开
-
【小熊刷题】Validate Binary Search Tree <含recursion>
QuestionGiven a binary tree, determine if it is a valid Binary Search Tree (BST).原创 2015-08-25 05:49:38 · 471 阅读 · 0 评论 -
【小熊刷题】Binary Search Tree Iteration <Leetcode 179, Java>
QuestionImplement 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 next smallest number in the BST.原创 2015-09-10 06:26:08 · 281 阅读 · 0 评论 -
【小熊刷题】power of two, pow(x, n) <Leetcode 231, 50 Java>
Question 1Power of TwoGiven an integer, write a function to determine if it is a power of two. Question2 implement pow(x,n)原创 2015-09-05 04:02:42 · 526 阅读 · 0 评论 -
【小熊刷题】Merge K Sorted Linked Lists
QuestionMerge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.原创 2015-08-20 02:46:49 · 248 阅读 · 0 评论 -
【小熊刷题】Copy List with Random Pointer <可再复习思路>
Copy List with Random PointerQuestionA linked list is given such that each node contains an additional random pointer that could point to any node in the list or null.Return a deep copy of the list.原创 2015-08-20 06:11:46 · 238 阅读 · 0 评论 -
【小熊刷题】ZigZag Conversion <Leetcode 6, Java>
QuestionThe string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows return read row by row.原创 2015-09-11 03:29:30 · 457 阅读 · 0 评论 -
【小熊刷题】Container with Most Water <Leetcode 11, Java>
QuestionGiven n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0)...原创 2015-09-11 09:49:53 · 531 阅读 · 0 评论 -
【小熊刷题】Longest Common Prefix <Leetcode 14, Java>
QuestionWrite a function to find the longest common prefix string amongst an array of strings.原创 2015-09-11 09:53:26 · 419 阅读 · 0 评论 -
【小熊刷题】3Sum Closest <Leetcode 16, Java>
QuestionGiven an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers.原创 2015-09-12 02:56:59 · 368 阅读 · 0 评论 -
【小熊刷题】Letter Combinations of a Phone Number <Leetcode 17, Java>
Questioniven a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below.原创 2015-09-12 03:35:46 · 441 阅读 · 0 评论 -
【小熊刷题】Remove Nth Node From End of List <Leetcode 19, Java>
QuestionGiven a linked list, remove the nth node from the end of list and return its head.For example,Given linked list: 1->2->3->4->5, and n = 2.After removing the second node from the end, the linked原创 2015-09-12 04:15:25 · 281 阅读 · 0 评论 -
【小熊刷题】Reverse Linked List <Leetcode 206, Java>
QuestionReverse a singly linked list.原创 2015-09-10 07:19:05 · 288 阅读 · 0 评论 -
【小熊刷题】sqrt(x) <Leetcode 69 Java>
QuestionImplement int sqrt(int x).Compute and return the square root of x.原创 2015-09-04 10:05:32 · 358 阅读 · 0 评论 -
【小熊刷题】Maximum Depth of Binary Tree
QuestionGiven 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 leaf node.原创 2015-08-25 10:09:57 · 277 阅读 · 0 评论 -
【小熊刷题】Minimum Depth of Binary Tree
QuestionGiven 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 leaf node.原创 2015-08-25 10:52:39 · 618 阅读 · 0 评论 -
【小熊刷题】Convert Sorted Array to Balanced Binary Search Tree
QuestionGiven an array where elements are sorted in ascending order, convert it to a height balanced BST.原创 2015-08-26 02:04:25 · 243 阅读 · 0 评论 -
【小熊刷题】Convert Sorted List to Balanced Binary Search Tree<可再复习>
QuestionGiven a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.原创 2015-08-26 03:48:36 · 328 阅读 · 0 评论 -
【小熊刷题】Binary Tree Maximum Path Sum
QuestionGiven a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example, given the below binary tree,The highlighted path yields the maximum原创 2015-08-26 10:33:56 · 339 阅读 · 0 评论 -
【小熊刷题】Balanced Binary Tree
QuestionGiven a binary tree, determine if it is height-balanced. A height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ more than 1.原创 2015-08-25 23:37:11 · 304 阅读 · 0 评论 -
【小熊刷题】Add Two Numbers in Linked Lists
You are given two linked lists representing two non-negative numbers.原创 2015-08-17 10:20:10 · 634 阅读 · 0 评论 -
【小熊刷题】Binary Tree Right Side View <Leetcode 199, Java>
QuestionGiven a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.原创 2015-09-09 05:34:53 · 306 阅读 · 0 评论 -
【小熊刷题】Best Time to Buy and Sell Stock I <leetcode 121 Java>
Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction design an algorithm to find the maximum profit.原创 2015-09-01 23:35:45 · 358 阅读 · 0 评论 -
【小熊刷题】3 Sum <Leetcode 15,Java>
QuestionGiven an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.原创 2015-09-11 23:24:26 · 388 阅读 · 1 评论