The largest number could be n of walls. ...
                            
                            
                                分类:
其他好文   时间:
2017-09-03 10:09:23   
                                阅读次数:
173
                             
                    
                        
                            
                            
                                1、问题描述 You need to find the largest value in each row of a binary tree. Example: 2、边界条件:root==null 3、思路:层级遍历,每一层找到最大值,记录 4、代码实现 5、api ...
                            
                            
                                分类:
其他好文   时间:
2017-08-31 11:08:25   
                                阅读次数:
169
                             
                    
                        
                            
                            
                                Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4],t ...
                            
                            
                                分类:
编程语言   时间:
2017-08-29 13:05:15   
                                阅读次数:
180
                             
                    
                        
                            
                            
                                题意:给定一个有向图,求一个最大的结点集,使得任意两个结点,要么 u 能到 v,要么 v 到u。 析:首先,如果是同一个连通分量,那么要么全选,要么全不选,然后我们就可以先把强连通分量先求出来,然后缩成一个点,然后该图就成了一个DAG,然后就可以直接用DP来做了。 代码如下: ...
                            
                            
                                分类:
其他好文   时间:
2017-08-29 11:06:58   
                                阅读次数:
128
                             
                    
                        
                            
                            
                                Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For exam ...
                            
                            
                                分类:
其他好文   时间:
2017-08-26 18:21:59   
                                阅读次数:
113
                             
                    
                        
                            
                            
                                Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For exam ...
                            
                            
                                分类:
其他好文   时间:
2017-08-24 19:52:04   
                                阅读次数:
185
                             
                    
                        
                            
                            
                                Comparing two numbers written in index form like 211 and 37 is not difficult, as any calculator would confirm that 211 = 2048 < 37 = 2187. However, co ...
                            
                            
                                分类:
编程语言   时间:
2017-08-24 13:29:28   
                                阅读次数:
219
                             
                    
                        
                            
                            
                                UVa 10074 题意:求01矩阵的最大子0矩阵。 http://www.csie.ntnu.edu.tw/~u91029/MaximumSubarray.html#2 这里说的很清楚。先求Largest Empty Interval,枚举每个点为矩形的右下角。 按照下一个更高效的算法写,不知道为 ...
                            
                            
                                分类:
其他好文   时间:
2017-08-21 11:30:01   
                                阅读次数:
238
                             
                    
                        
                            
                            
                                You need to find the largest value in each row of a binary tree.Example:Input: 1 / \ 3 2 / \ \ 5 3 9 Output: [1, 3, 9] 题意:找出二叉树一层的最大值解法:用BFS的方式遍历每... ...
                            
                            
                                分类:
其他好文   时间:
2017-08-19 22:14:21   
                                阅读次数:
270
                             
                    
                        
                            
                            
                                    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 ...
                            
                            
                                分类:
其他好文   时间:
2017-08-19 14:17:25   
                                阅读次数:
209