上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 37 下一页
摘要: Given a binary search tree with the following tree node definition. next points to a node's inorder successor. Populate inorder successor for all node 阅读全文
posted @ 2017-08-23 03:42 Review->Improve 阅读(337) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, get all nodes that don't have sibling node, excluding the root node. Level order and pre order solutions. 阅读全文
posted @ 2017-08-23 00:39 Review->Improve 阅读(270) 评论(0) 推荐(0) 编辑
摘要: Given an array of positive number, find maximum sum subsequence such that elements in this subsequence are not adjacent to each other. Recursive formu 阅读全文
posted @ 2017-08-22 13:13 Review->Improve 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Find longest bitonic subsequence in given array. Bitonic subsequence first increases then decreases. Same problem link Longest Bitonic Subsequence 阅读全文
posted @ 2017-08-22 12:13 Review->Improve 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Given a staircase and give you can take 1 or 2 steps at a time, how many ways you can reach nth step. Same problem link. Climbing Stairs 阅读全文
posted @ 2017-08-22 12:11 Review->Improve 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Given a 2D immutable array, Write an efficient program to support any given sub-rectangle sum query in this 2D matrix. A simple solution is to add eac 阅读全文
posted @ 2017-08-22 12:08 Review->Improve 阅读(173) 评论(0) 推荐(0) 编辑
摘要: Find Maximum Number that can be formed using all digits in the given integer. Solution 1. O(n * log n) runtime, O(n) space using sorting A simple solu 阅读全文
posted @ 2017-08-22 05:16 Review->Improve 阅读(365) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array of integers, sort this array using tree sort. 1. Create a binary search tree by inserting array elements. 2. Perform in order 阅读全文
posted @ 2017-08-22 01:44 Review->Improve 阅读(228) 评论(0) 推荐(0) 编辑
摘要: Given Inorder and Preorder traversals of a binary tree, print Postorder traversal. Example: A naive solution is to first construct the given tree, the 阅读全文
posted @ 2017-08-22 00:59 Review->Improve 阅读(333) 评论(0) 推荐(0) 编辑
摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest square which diagonal is all 1 and others is 0. Only consider the main diagonal sit 阅读全文
posted @ 2017-08-19 11:40 Review->Improve 阅读(780) 评论(0) 推荐(0) 编辑
上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 37 下一页