摘要: Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or 阅读全文
posted @ 2016-06-23 17:16 Miller1991 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST. Subscribe to see which companies asked this question 阅读全文
posted @ 2016-06-23 16:43 Miller1991 阅读(94) 评论(0) 推荐(0) 编辑
摘要: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: S 阅读全文
posted @ 2016-06-23 16:26 Miller1991 阅读(116) 评论(0) 推荐(0) 编辑
摘要: Given 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' 阅读全文
posted @ 2016-06-23 15:46 Miller1991 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, every element appears three times except for one. Find that single one. Note:Your algorithm should have a linear runtime c 阅读全文
posted @ 2016-06-23 11:45 Miller1991 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tree [1,null,2,3], return [1,3,2]. Note: Recursive so 阅读全文
posted @ 2016-06-23 10:48 Miller1991 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 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 @ 2016-06-23 10:09 Miller1991 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the 阅读全文
posted @ 2016-06-23 09:52 Miller1991 阅读(177) 评论(0) 推荐(0) 编辑