02 2017 档案

摘要:Given the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a node is defined as the sum of all the node values 阅读全文
posted @ 2017-02-28 23:43 Grandyang 阅读(6521) 评论(1) 推荐(1) 编辑
摘要:Given scores of N athletes, find their relative ranks and the people with the top three highest scores, who will be awarded medals: "Gold Medal", "Sil 阅读全文
posted @ 2017-02-27 23:34 Grandyang 阅读(5476) 评论(0) 推荐(0) 编辑
摘要:Given a circular array (the next element of the last element is the first element of the array), print the Next Greater Number for every element. The 阅读全文
posted @ 2017-02-25 21:12 Grandyang 阅读(11224) 评论(0) 推荐(0) 编辑
摘要:Given a binary search tree (BST) with duplicates, find all the mode(s) (the most frequently occurred element) in the given BST. Assume a BST is define 阅读全文
posted @ 2017-02-23 23:45 Grandyang 阅读(12845) 评论(8) 推荐(2) 编辑
摘要:Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below. Examp 阅读全文
posted @ 2017-02-20 21:55 Grandyang 阅读(6745) 评论(2) 推荐(0) 编辑
摘要:Given an integer, return its base 7 string representation. Example 1: Example 2: Note: The input will be in range of [-1e7, 1e7]. 这道题给了我们一个数,让我们转为七进制的 阅读全文
posted @ 2017-02-20 00:09 Grandyang 阅读(6935) 评论(2) 推荐(0) 编辑
摘要:You need to find the largest value in each row of a binary tree. Example: 这道题让我们找二叉树每行的最大的结点值,那么实际上最直接的方法就是用层序遍历,然后在每一层中找到最大值,加入结果res中即可,参见代码如下: 解法一: 阅读全文
posted @ 2017-02-19 23:29 Grandyang 阅读(4949) 评论(0) 推荐(0) 编辑
摘要:Given a matrix of M x N elements (M rows, N columns), return all elements of the matrix in diagonal order as shown in the below image. Example: Note: 阅读全文
posted @ 2017-02-18 23:13 Grandyang 阅读(13444) 评论(1) 推荐(0) 编辑
摘要:Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Example 2: Note: You may assume the tree (i.e., the given root no 阅读全文
posted @ 2017-02-16 12:28 Grandyang 阅读(7032) 评论(4) 推荐(0) 编辑
摘要:You are given two integer arrays nums1 and nums2 both of unique elements, where nums1 is a subset of nums2. Find all the next greater numbers for nums 阅读全文
posted @ 2017-02-15 03:15 Grandyang 阅读(17204) 评论(5) 推荐(1) 编辑
摘要:In LLP world, there is a hero called Teemo and his attacking can make his enemy Ashe be in poisoned condition. Now, given the Teemo's attacking ascend 阅读全文
posted @ 2017-02-14 22:01 Grandyang 阅读(4825) 评论(0) 推荐(0) 编辑
摘要:You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose o 阅读全文
posted @ 2017-02-13 23:21 Grandyang 阅读(19963) 评论(8) 推荐(1) 编辑
摘要:For a web developer, it is very important to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by now i 阅读全文
posted @ 2017-02-11 23:57 Grandyang 阅读(3598) 评论(6) 推荐(0) 编辑
摘要:Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing su 阅读全文
posted @ 2017-02-10 22:11 Grandyang 阅读(9036) 评论(5) 推荐(2) 编辑
摘要:There is a ball in a maze with empty spaces and walls. The ball can go through empty spaces by rolling up, down, left or right, but it won't stop roll 阅读全文
posted @ 2017-02-09 11:57 Grandyang 阅读(26802) 评论(10) 推荐(2) 编辑
摘要:将Qt4的项目迁到Qt5中并不需要新建一个Qt5的工程,可以直接在原工程文件上修改,这里我们使用的是VS2010和Qt5.4的环境,我们需要做以下修改: 1. 在工程里找到这个文件:工程名.vcxproj.user,将里面的Qtdir路径修改为:C:\Qt\5.4\msvc2010_opengl。我 阅读全文
posted @ 2017-02-08 00:17 Grandyang 阅读(1479) 评论(0) 推荐(0) 编辑
摘要:Given a binary array, find the maximum number of consecutive 1s in this array if you can flip at most one 0. Example 1: Input: [1,0,1,1,0] Output: 4 E 阅读全文
posted @ 2017-02-07 22:15 Grandyang 阅读(11130) 评论(2) 推荐(2) 编辑
摘要:When compile program using Visual Studio 2015, Matlab 2016b, and OpenCV 3.1.0, one might get the error as follow: Undefined function or variable ‘setI 阅读全文
posted @ 2017-02-07 02:14 Grandyang 阅读(1922) 评论(0) 推荐(0) 编辑
摘要:Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and t 阅读全文
posted @ 2017-02-06 11:25 Grandyang 阅读(12624) 评论(4) 推荐(0) 编辑
摘要:By now, you are given a secret signature consisting of character 'D' and 'I'. 'D' represents a decreasing relationship between two numbers, 'I' repres 阅读全文
posted @ 2017-02-05 00:07 Grandyang 阅读(7374) 评论(4) 推荐(1) 编辑
摘要:在Qt和PCL联合编译的过程中,会出现各种各样的错误,解决这些错误的过程真是痛苦万分,所以总结一些常见错误方便自己也方便他人。比如我们要编译PCL1.8.0中的apps中的point_cloud_editor这个应用时,可能会遇到如下错误: 这个错误的解决方法很简单,哪个cpp文件产生了这些错误,就 阅读全文
posted @ 2017-02-04 07:28 Grandyang 阅读(1061) 评论(0) 推荐(0) 编辑
摘要:在编译一些大型SDK的时候,比如Qt,OpenCV, PCL, VTK, ITK等等,在VS中,我们需要将编译生成的.lib文件加入Linker->Input中,但是往往生成的.lib文件有很多很多个,一个一个的把名字加进来实在是太累,我们可以用cmd命令行来快速获得某个文件夹下的所有文件的名字,打 阅读全文
posted @ 2017-02-03 04:53 Grandyang 阅读(335) 评论(0) 推荐(0) 编辑
摘要:Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: [1,1,0,1,1,1] Output: 3 Explanation: The first two di 阅读全文
posted @ 2017-02-02 10:00 Grandyang 阅读(8368) 评论(0) 推荐(0) 编辑

Fork me on GitHub