上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 44 下一页
摘要: Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST's 阅读全文
posted @ 2015-07-03 23:53 Grandyang 阅读(24017) 评论(10) 推荐(2)
摘要: cvReleaseImage是OpenCV中C语言库中的释放图片内存的函数,比如我们加载或者克隆了一幅图片,当不需要这幅图片了时,我们为了避免内存泄露,需要释放这些空间,可以参见我之前的博客OpenCV Show Image cvShowImage() 使用方法,其使用方法如下:IplImage *... 阅读全文
posted @ 2015-07-02 03:03 Grandyang 阅读(5460) 评论(0) 推荐(0)
摘要: fc2Image是FlyCapture SDK的C语言库中的图片格式,由于在Windows上的MinGW无法编译FlyCapture2的C++库,只能使用C语言库,所以当我们在同时使用OpenCV的图像格式IplImage时,有时候就需要两种格式相互转换。如果需要FlyCapture2 Image和... 阅读全文
posted @ 2015-07-01 03:12 Grandyang 阅读(2160) 评论(0) 推荐(0)
摘要: Install FlyCatprue2 to the folder "C:\PointGreyResearch\"Add the following to the .pro file:# Add FlyCapture2INCLUDEPATH += C:\PointGreyResearch\FlyCa... 阅读全文
posted @ 2015-07-01 00:22 Grandyang 阅读(1698) 评论(0) 推荐(0)
摘要: Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Exampl 阅读全文
posted @ 2015-06-29 10:30 Grandyang 阅读(25511) 评论(5) 推荐(2)
摘要: Given the head of a linked list, remove the nth node from the end of the list and return its head. Example 1: Input: head = [1,2,3,4,5], n = 2 Output: 阅读全文
posted @ 2015-06-29 10:28 Grandyang 阅读(20638) 评论(15) 推荐(0)
摘要: Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Note: The algorithm should run in linear time and in O(1) spa 阅读全文
posted @ 2015-06-29 09:52 Grandyang 阅读(25953) 评论(11) 推荐(0)
摘要: You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the linked-lists into one sorted linked-list 阅读全文
posted @ 2015-06-29 08:59 Grandyang 阅读(40347) 评论(14) 推荐(1)
摘要: Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The order of the elements may be changed. Then return  阅读全文
posted @ 2015-06-29 08:54 Grandyang 阅读(15628) 评论(0) 推荐(0)
摘要: Given two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Exampl 阅读全文
posted @ 2015-06-29 08:51 Grandyang 阅读(21846) 评论(2) 推荐(0)
摘要: Given an input string, reverse the string word by word. For example, Given s = "the sky is blue", return "blue is sky the". Update (2015-02-12): For C 阅读全文
posted @ 2015-06-29 08:14 Grandyang 阅读(24881) 评论(2) 推荐(2)
摘要: 终于将LeetCode的大部分题刷完了,真是漫长的第一遍啊,估计很多题都忘的差不多了,这次开个题目汇总贴,并附上每道题目的解题连接,方便之后查阅吧~ 博主还制作了一款 网页版APP,方便大家进行查阅,网址如下: https://grandyang.com 对应的 Github 项目 的同步地址如下, 阅读全文
posted @ 2015-06-28 23:20 Grandyang 阅读(1317419) 评论(156) 推荐(116)
摘要: Given a sorted integer array without duplicates, return the summary of its ranges. Example 1: Example 2: Credits:Special thanks to @jianchao.li.fighte 阅读全文
posted @ 2015-06-27 02:25 Grandyang 阅读(12763) 评论(6) 推荐(1)
摘要: 相机参数如下,参见这里:Resolution1624 x 1224Frame Rate30 FPSMegapixels2.0 MPChromaColorSensor NameSony ICX274Sensor TypeCCDReadout MethodGlobal shutterSensor For... 阅读全文
posted @ 2015-06-26 04:20 Grandyang 阅读(686) 评论(0) 推荐(0)
摘要: Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negativeintegers, +, -, *, / operators an 阅读全文
posted @ 2015-06-25 23:13 Grandyang 阅读(26625) 评论(9) 推荐(1)
摘要: 原文地址:http://www.licai.com/yuedu/201411-62884.html如果你对各大耳熟能详的国际酒店管理集团还有什么问题,相信今天和你分享的各大酒店集团家族系谱图和最全介绍会帮助到你很多。不管你是酒店行业人士还是高端酒店控,都不要错过这次风暴般的洗脑。 一、洲际酒店集团(... 阅读全文
posted @ 2015-06-24 11:53 Grandyang 阅读(7154) 评论(0) 推荐(0)
摘要: QRadioButton 控件是Qt中实现多选一功能的控件,它的使用方法如下:声明控件:QRadioButton *rbutton;然后实现它的响应函数:void YourClass::on_rbutton_toggled(bool state) { // Implement here if (... 阅读全文
posted @ 2015-06-23 03:54 Grandyang 阅读(6343) 评论(0) 推荐(0)
摘要: 在Qt中,QLineEdit是文本编辑框控件,是比较基础且常用的控件的之一,下面是其的一些基本操作。 比如: 禁用或启用该控件 设置内容或者返回内容: 将控件设为只读模式: 控件只接受整型或者浮点型: 文本改变响应函数: 阅读全文
posted @ 2015-06-19 06:32 Grandyang 阅读(6501) 评论(0) 推荐(0)
摘要: Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) - Get the 阅读全文
posted @ 2015-06-19 03:10 Grandyang 阅读(30218) 评论(15) 推荐(2)
摘要: 原文地址: http://www.3798.com/archives/596.html接着对我们这种不是某个酒店忠诚客户的用户选择卡片进行分析。首先要强调的是,我们比较的是信用卡项目本身,而不是酒店忠诚计划的好坏。个人感觉,对于酒店信用卡,最重要的是开卡奖励的价值、附送的会员等级以及年费成本。至于每... 阅读全文
posted @ 2015-06-17 03:46 Grandyang 阅读(1919) 评论(0) 推荐(0)
摘要: Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. Example 1: Example 2: 这道题给了我们一堆二维点,然后让求最大的共线点的个数,根 阅读全文
posted @ 2015-06-16 04:37 Grandyang 阅读(20765) 评论(14) 推荐(1)
摘要: Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, add spaces in s to construct a sentence where each word is 阅读全文
posted @ 2015-06-15 05:49 Grandyang 阅读(25420) 评论(7) 推荐(1)
摘要: There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following re 阅读全文
posted @ 2015-06-14 14:21 Grandyang 阅读(24632) 评论(13) 推荐(1)
摘要: Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem was inspired by thi... 阅读全文
posted @ 2015-06-13 00:54 Grandyang 阅读(18904) 评论(3) 推荐(4)
摘要: Implement a basic calculator to evaluate a simple expression string. The expression string may contain open ( and closing parentheses ), the plus + or 阅读全文
posted @ 2015-06-12 02:30 Grandyang 阅读(28113) 评论(5) 推荐(1)
摘要: Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. to 阅读全文
posted @ 2015-06-11 12:49 Grandyang 阅读(13597) 评论(5) 推荐(0)
摘要: Given a complete binary tree, count the number of nodes. Note: Definition of a complete binary tree from Wikipedia:In a complete binary tree every lev 阅读全文
posted @ 2015-06-10 23:49 Grandyang 阅读(19514) 评论(7) 推荐(1)
摘要: Find the total area covered by two rectilinearrectangles in a 2D plane. Each rectangle is defined by its bottom left corner and top right corner as sh 阅读全文
posted @ 2015-06-09 12:56 Grandyang 阅读(10846) 评论(4) 推荐(0)
摘要: Given a 2D board containing 'X' and 'O'(the letter O), capture all regions surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in t 阅读全文
posted @ 2015-06-05 23:55 Grandyang 阅读(22734) 评论(26) 推荐(0)
摘要: stack, deque 和 queue这三个c++的STL的数据结构很类似但又各有不同。stack是堆栈,没有迭代器,特点是后进先出。用push()将元素压入栈中,top()返回栈顶元素,pop()移除栈顶元素。deque是双端队列,支持迭代器,使用push_back()在队尾添加元素,pop_b... 阅读全文
posted @ 2015-06-04 23:51 Grandyang 阅读(5596) 评论(0) 推荐(0)
摘要: Given an m x n binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. Example 1: Input: matrix = [["1 阅读全文
posted @ 2015-06-03 23:22 Grandyang 阅读(27834) 评论(16) 推荐(0)
摘要: Given two words (beginWord and endWord), and a dictionary's word list, find all shortest transformation sequence(s) from beginWord to endWord, such th 阅读全文
posted @ 2015-06-03 02:31 Grandyang 阅读(26682) 评论(14) 推荐(0)
摘要: Given an array of integers, find out whether there are two distinct indices i and j in the array such that the difference between nums[i] and nums[j] 阅读全文
posted @ 2015-06-01 23:33 Grandyang 阅读(26192) 评论(16) 推荐(0)
摘要: A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 -> s2 -> ... -> sk su 阅读全文
posted @ 2015-05-30 07:06 Grandyang 阅读(27694) 评论(19) 推荐(3)
摘要: 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. Example 阅读全文
posted @ 2015-05-30 04:10 Grandyang 阅读(36137) 评论(26) 推荐(2)
摘要: Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the  阅读全文
posted @ 2015-05-30 00:06 Grandyang 阅读(18335) 评论(11) 推荐(0)
摘要: Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be 阅读全文
posted @ 2015-05-29 11:04 Grandyang 阅读(14248) 评论(0) 推荐(2)
摘要: 在使用C++的STL时,经常会用到迭代器,那么不得不搞清楚里面的一些指针 begin(), end(), rbegin(), rend()之间的区别与联系,以及它们分别都指向哪个元素。首先要明白的一点是它们都是指针,其中begin()指向第一个元素,我们容易误认为end()是指向最后一个元素,其实不... 阅读全文
posted @ 2015-05-28 23:10 Grandyang 阅读(3848) 评论(0) 推荐(2)
摘要: Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr... 阅读全文
posted @ 2015-05-28 21:40 Grandyang 阅读(15911) 评论(3) 推荐(0)
摘要: A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Now suppose you are give 阅读全文
posted @ 2015-05-27 22:24 Grandyang 阅读(27034) 评论(10) 推荐(1)
上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 44 下一页
Fork me on GitHub