摘要:
Given a singly linked list, determine if it is a palindrome. Example 1: Input: 1->2 Output: false Example 2: Input: 1->2->2->1 Output: true Follow up:
阅读全文
posted @ 2015-07-10 12:38
Grandyang
阅读(34683)
推荐(3)
摘要:
Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n. Example 1: Input: n = 13 Output:
阅读全文
posted @ 2015-07-08 02:50
Grandyang
阅读(20276)
推荐(3)
摘要:
Implement the following operations of a queue using stacks. push(x) -- Push element x to the back of queue. pop() -- Removes the element from in front
阅读全文
posted @ 2015-07-07 10:30
Grandyang
阅读(13730)
推荐(1)
摘要:
Given an integer, write a function to determine if it is a power of two. Example 1: Example 2: Example 3: 这道题让我们判断一个数是否为2的次方数,而且要求时间和空间复杂度都为常数,那么对于这种玩
阅读全文
posted @ 2015-07-06 04:40
Grandyang
阅读(21306)
推荐(2)
摘要:
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
阅读(24353)
推荐(2)
摘要:
cvReleaseImage是OpenCV中C语言库中的释放图片内存的函数,比如我们加载或者克隆了一幅图片,当不需要这幅图片了时,我们为了避免内存泄露,需要释放这些空间,可以参见我之前的博客OpenCV Show Image cvShowImage() 使用方法,其使用方法如下:IplImage *...
阅读全文
posted @ 2015-07-02 03:03
Grandyang
阅读(5569)
推荐(0)
摘要:
fc2Image是FlyCapture SDK的C语言库中的图片格式,由于在Windows上的MinGW无法编译FlyCapture2的C++库,只能使用C语言库,所以当我们在同时使用OpenCV的图像格式IplImage时,有时候就需要两种格式相互转换。如果需要FlyCapture2 Image和...
阅读全文
posted @ 2015-07-01 03:12
Grandyang
阅读(2254)
推荐(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
阅读(1761)
推荐(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
阅读(25907)
推荐(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
阅读(21019)
推荐(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
阅读(26136)
推荐(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
阅读(40896)
推荐(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
阅读(15885)
推荐(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
阅读(22130)
推荐(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
阅读(25193)
推荐(2)
摘要:
终于将LeetCode的大部分题刷完了,真是漫长的第一遍啊,估计很多题都忘的差不多了,这次开个题目汇总贴,并附上每道题目的解题连接,方便之后查阅吧~ 博主还制作了一款 网页版APP,方便大家进行查阅,网址如下: https://grandyang.com 对应的 Github 项目 的同步地址如下,
阅读全文
posted @ 2015-06-28 23:20
Grandyang
阅读(1335597)
推荐(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
阅读(12906)
推荐(1)
摘要:
相机参数如下,参见这里:Resolution1624 x 1224Frame Rate30 FPSMegapixels2.0 MPChromaColorSensor NameSony ICX274Sensor TypeCCDReadout MethodGlobal shutterSensor For...
阅读全文
posted @ 2015-06-26 04:20
Grandyang
阅读(746)
推荐(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
阅读(26958)
推荐(1)
摘要:
原文地址:http://www.licai.com/yuedu/201411-62884.html如果你对各大耳熟能详的国际酒店管理集团还有什么问题,相信今天和你分享的各大酒店集团家族系谱图和最全介绍会帮助到你很多。不管你是酒店行业人士还是高端酒店控,都不要错过这次风暴般的洗脑。 一、洲际酒店集团(...
阅读全文
posted @ 2015-06-24 11:53
Grandyang
阅读(7432)
推荐(0)
摘要:
QRadioButton 控件是Qt中实现多选一功能的控件,它的使用方法如下:声明控件:QRadioButton *rbutton;然后实现它的响应函数:void YourClass::on_rbutton_toggled(bool state) { // Implement here if (...
阅读全文
posted @ 2015-06-23 03:54
Grandyang
阅读(6400)
推荐(0)
摘要:
在Qt中,QLineEdit是文本编辑框控件,是比较基础且常用的控件的之一,下面是其的一些基本操作。 比如: 禁用或启用该控件 设置内容或者返回内容: 将控件设为只读模式: 控件只接受整型或者浮点型: 文本改变响应函数:
阅读全文
posted @ 2015-06-19 06:32
Grandyang
阅读(6583)
推荐(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
阅读(30957)
推荐(2)
摘要:
原文地址: http://www.3798.com/archives/596.html接着对我们这种不是某个酒店忠诚客户的用户选择卡片进行分析。首先要强调的是,我们比较的是信用卡项目本身,而不是酒店忠诚计划的好坏。个人感觉,对于酒店信用卡,最重要的是开卡奖励的价值、附送的会员等级以及年费成本。至于每...
阅读全文
posted @ 2015-06-17 03:46
Grandyang
阅读(1988)
推荐(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
阅读(21039)
推荐(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
阅读(25687)
推荐(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
阅读(24960)
推荐(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
阅读(19085)
推荐(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
阅读(28517)
推荐(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
阅读(13784)
推荐(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
阅读(19783)
推荐(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
阅读(10988)
推荐(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
阅读(23029)
推荐(0)
摘要:
stack, deque 和 queue这三个c++的STL的数据结构很类似但又各有不同。stack是堆栈,没有迭代器,特点是后进先出。用push()将元素压入栈中,top()返回栈顶元素,pop()移除栈顶元素。deque是双端队列,支持迭代器,使用push_back()在队尾添加元素,pop_b...
阅读全文
posted @ 2015-06-04 23:51
Grandyang
阅读(5667)
推荐(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
阅读(28139)
推荐(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
阅读(26934)
推荐(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
阅读(26385)
推荐(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
阅读(28094)
推荐(3)
摘要:
Given an integer array nums and an integer k, return the kth largest element in the array. Note that it is the kth largest element in the sorted order
阅读全文
posted @ 2015-05-30 04:10
Grandyang
阅读(36774)
推荐(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
阅读(18537)
推荐(0)