LeetCode Unique Binary Search Trees DescriptionGiven n, how many structurally unique BST’s (binary search trees) that store values 1…n? For example,Given n = 3, there are a total of 5 unique BST’s. 1 3 3 2 1 7月 11 2015 #leetcode
LeetCode Implement Stack Using Queues DescriptionImplement the following operations of a stack using queues. push(x) – Push element x onto stack. pop() – Removes the element on top of the stack. top() – Get the top element. empty() – Ret 7月 10 2015 #leetcode
LeetCode Populating Next Right Pointers in Each Node DescriptionGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its next right node. If ther 7月 10 2015 #leetcode
LeetCode Populating Next Right Pointers in Each Node 2 DescriptionFollow up for problem “Populating Next Right Pointers in Each Node”. What if the given tree could be any binary tree? Would your previous solution still work? Note: You may only use constan 7月 10 2015 #leetcode
LeetCode Climbing Stairs DescriptionYou are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? The original problem is 7月 10 2015 #leetcode
LeetCode Binary Tree Inorder Traversal DescriptionGiven a binary tree, return the inorder traversal of its nodes’ values. For example:Given binary tree {1,#,2,3}, 1 2 / 3return [1,3,2]. The original problem is here. The orig 7月 10 2015 #leetcode
LeetCode Palindrome Linked List DescriptionGiven a singly linked list, determine if it is a palindrome. The original problem is here. The original code is here. 7月 10 2015 #leetcode
LeetCode Implement Queue Using Stacks DescriptionImplement the following operations of a queue using stacks. push(x) – Push element x to the back of queue. pop() – Removes the element from in front of queue. peek() – Get the front elemen 7月 9 2015 #leetcode
LeetCode Pascal's Triangle2 DescriptionGiven an index k, return the kth row of the Pascal’s triangle. For example, given k = 3,Return [1,3,3,1]. The original problem is here. The original code is here. 7月 9 2015 #leetcode
LeetCode Best Time To Buy And Sell Stock 2 DescriptionSay you have an array for which the i(th) element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete as many transactions as you like ( 7月 9 2015 #leetcode