09 2017 档案

摘要:Given a string that contains only digits 0-9 and a target value, return all possibilities to add binary operators (not unary) +, -, or * between the d 阅读全文
posted @ 2017-09-29 07:26 Review->Improve 阅读(268) 评论(0) 推荐(0)
摘要:Given A binary Tree, how do you remove all the half nodes (which has only one child)? Note leaves should not be touched as they have both children as 阅读全文
posted @ 2017-09-29 01:47 Review->Improve 阅读(199) 评论(0) 推荐(0)
摘要:Given a digit string excluded 01, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on 阅读全文
posted @ 2017-09-28 11:39 Review->Improve 阅读(301) 评论(0) 推荐(0)
摘要:Given a list of numbers with duplicate number in it. Find all unique permutations. Have you met this question in a real interview? Yes Given a list of 阅读全文
posted @ 2017-09-28 10:15 Review->Improve 阅读(308) 评论(0) 推荐(0)
摘要:Given a list of numbers, return all possible permutations. You can assume that there is no duplicate numbers in the list. Given a list of numbers, ret 阅读全文
posted @ 2017-09-28 05:47 Review->Improve 阅读(163) 评论(0) 推荐(0)
摘要:Given n friends, each one can remain single or can be paired up with some other friend. Each friend can be paired only once. Find out the total number 阅读全文
posted @ 2017-09-28 04:58 Review->Improve 阅读(735) 评论(0) 推荐(0)
摘要:Given a list of Connections, which is the Connection class (the city name at both ends of the edge and a cost between them), find some edges, connect 阅读全文
posted @ 2017-09-27 12:55 Review->Improve 阅读(1781) 评论(0) 推荐(1)
摘要:Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'. A region is captured by flipping all 'O''s into 'X''s in that surround 阅读全文
posted @ 2017-09-27 06:42 Review->Improve 阅读(238) 评论(0) 推荐(0)
摘要:A non-negative numbers can be regarded as product of its factors.Write a function that takes an integer n and return all possible combinations of its 阅读全文
posted @ 2017-09-26 13:49 Review->Improve 阅读(563) 评论(0) 推荐(0)
摘要:You are given a m x n 2D grid initialized with these three possible values. -1 - A wall or an obstacle.0 - A gate.INF - Infinity means an empty room. 阅读全文
posted @ 2017-09-26 12:31 Review->Improve 阅读(519) 评论(0) 推荐(0)
摘要:Given a set of n nuts of different sizes and n bolts of different sizes. There is a one-one mapping between nuts and bolts. Comparison of a nut to ano 阅读全文
posted @ 2017-09-25 14:01 Review->Improve 阅读(534) 评论(0) 推荐(0)
摘要:The code base version is an integer start from 1 to n. One day, someone committed a bad version in the code case, so it caused this version and the fo 阅读全文
posted @ 2017-09-15 06:29 Review->Improve 阅读(145) 评论(0) 推荐(0)
摘要:Calculate the (a^n) % b where a, b and n are all 32bit integers. Calculate the (a^n) % b where a, b and n are all 32bit integers. Calculate the (a^n) 阅读全文
posted @ 2017-09-15 05:58 Review->Improve 阅读(227) 评论(0) 推荐(0)
摘要:The diameter of a tree (sometimes called the width) is the number of nodes on the longest path between two leaves in the tree. The diagram below shows 阅读全文
posted @ 2017-09-15 03:58 Review->Improve 阅读(253) 评论(0) 推荐(0)
摘要:Given a binary tree with each node having one extra field of nextRight. nextRight points to the next right node of the same level. Initially all nodes 阅读全文
posted @ 2017-09-13 14:01 Review->Improve 阅读(243) 评论(0) 推荐(0)
摘要:Given a Binary Tree, find if there exist edge whose removal creates two trees of equal size. Examples: To find whether such an edge exists, we need to 阅读全文
posted @ 2017-09-13 06:53 Review->Improve 阅读(394) 评论(0) 推荐(0)
摘要:Given a sorted array of n integers, find the starting and ending position of a given target value. If the target is not found in the array, return [-1 阅读全文
posted @ 2017-09-08 12:20 Review->Improve 阅读(152) 评论(0) 推荐(0)
摘要:Given a binary search tree (See Definition) and a node in it, find the in-order successor of that node in the BST. If the given node has no in-order s 阅读全文
posted @ 2017-09-08 12:15 Review->Improve 阅读(344) 评论(0) 推荐(0)
摘要:Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, flip it up 阅读全文
posted @ 2017-09-07 11:01 Review->Improve 阅读(291) 评论(0) 推荐(0)
摘要:Given a binary tree, collect a tree's nodes as if you were doing this: Collect and remove all leaves, repeat until the tree is empty. Have you met thi 阅读全文
posted @ 2017-09-07 06:12 Review->Improve 阅读(266) 评论(0) 推荐(0)
摘要:Given a binary tree, return the vertical order traversal of its nodes' values. (ie, from top to bottom, column by column). If two nodes are in the sam 阅读全文
posted @ 2017-09-07 04:48 Review->Improve 阅读(354) 评论(0) 推荐(0)
摘要:Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all 阅读全文
posted @ 2017-09-07 01:56 Review->Improve 阅读(142) 评论(0) 推荐(0)
摘要:Given a binary tree, check whether it is a mirror of itself using both recursion and iterative approach. Examples: Solution 1. Recursion For two trees 阅读全文
posted @ 2017-09-07 00:33 Review->Improve 阅读(181) 评论(0) 推荐(0)
摘要:Given a Binary Tree, extract all leaves of it in a Doubly Linked List (DLL). Note that the DLL need to be created in-place. Assume that the node struc 阅读全文
posted @ 2017-09-06 12:54 Review->Improve 阅读(285) 评论(0) 推荐(0)
摘要:Consider a game where a player can score 3 or 5 or 10 points in a move. Given a total score n, find the number of ways to reach the given score. Examp 阅读全文
posted @ 2017-09-06 11:57 Review->Improve 阅读(927) 评论(0) 推荐(0)
摘要:Given a 2D matrix of integers, find maximum sum rectangle in this matrix. Brute force solution of enumerating all possible submatrix then check their 阅读全文
posted @ 2017-09-05 15:04 Review->Improve 阅读(614) 评论(0) 推荐(0)
摘要:Given a 2D matrix of 0s and 1s, find maximum size rectangle of all 1s in this matrix. Brute force solution is very inefficient. A better solution is t 阅读全文
posted @ 2017-09-05 13:17 Review->Improve 阅读(207) 评论(0) 推荐(0)
摘要:Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the hist 阅读全文
posted @ 2017-09-05 12:37 Review->Improve 阅读(312) 评论(0) 推荐(0)
摘要:You are given n pairs of numbers. In every pair, the first number is always smaller than the second number. A pair (c, d) can follow another pair (a, 阅读全文
posted @ 2017-09-05 09:13 Review->Improve 阅读(542) 评论(0) 推荐(0)