上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 38 下一页
摘要: 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 阅读(794) 评论(0) 推荐(0)
摘要: Given a 2D matrix where every element is either ‘O’ or ‘X’, find the largest subsquare surrounded by ‘X’. Examples: Solution 1. O(N^4) runtime. Consid 阅读全文
posted @ 2017-08-19 08:47 Review->Improve 阅读(386) 评论(0) 推荐(0)
摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area. For example, given the following mat 阅读全文
posted @ 2017-08-19 07:27 Review->Improve 阅读(227) 评论(0) 推荐(0)
摘要: Given a number n, find the total number of numbers from 0 to 2^n - 1 which do not have consecutive 1s in their binary representation. Solution. This p 阅读全文
posted @ 2017-08-19 04:15 Review->Improve 阅读(122) 评论(0) 推荐(0)
摘要: Give a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from root node down to the nearest leaf n 阅读全文
posted @ 2017-08-19 04:05 Review->Improve 阅读(154) 评论(0) 推荐(0)
摘要: Given n which is total number of keys in BST, how many BSTs can be formed with n keys. Solution 1. Recursion Solution 2. Dynamic Programming 阅读全文
posted @ 2017-08-18 15:45 Review->Improve 阅读(129) 评论(0) 推荐(0)
摘要: Given a 2 dimensional matrix, how many ways you can reach bottom right from top left provided you can only move down and right. 阅读全文
posted @ 2017-08-18 15:26 Review->Improve 阅读(117) 评论(0) 推荐(0)
摘要: Count Number of Binary Tree Possible given Preorder Sequence. For example, given preorder sequence of {10, 11, 9, 12, 13, 14}, the total possible numb 阅读全文
posted @ 2017-08-18 14:50 Review->Improve 阅读(247) 评论(0) 推荐(0)
摘要: Write a function to print spiral order traversal of a binary tree. For below tree, function should print 1, 2, 3, 4, 5, 6, 7. Solution. For a normal l 阅读全文
posted @ 2017-08-18 13:49 Review->Improve 阅读(378) 评论(0) 推荐(0)
摘要: Given coins of certain denominations and a total, how many ways these coins can be combined to get the total. Dynamic Programming solution State: T[i] 阅读全文
posted @ 2017-08-18 13:30 Review->Improve 阅读(145) 评论(0) 推荐(0)
上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 38 下一页