07 2015 档案

摘要:4.3 Given a sorted (increasing order) array with unique integer elements, write an algorithm to create a binary search tree with minimal height.这道题给了我... 阅读全文
posted @ 2015-07-31 23:24 Grandyang 阅读(731) 评论(0) 推荐(0) 编辑
摘要:4.2 Given a directed graph, design an algorithm to find out whether there is a route between two nodes.LeetCode和CareerCup中关于图的题都不是很多,LeetCode中只有三道,分别是... 阅读全文
posted @ 2015-07-30 23:50 Grandyang 阅读(1072) 评论(0) 推荐(0) 编辑
摘要:原文地址:http://blog.sina.com.cn/s/blog_ad7c19000102v42d.html一. 图形学、可视化领域的会议:(一)高级别会议1. Siggraph (图形学领域最高级别会议,不知SCI收录否。国内研究者除非结果特牛,轻易别投)2. Eurograph (作为Co... 阅读全文
posted @ 2015-07-30 06:22 Grandyang 阅读(2013) 评论(0) 推荐(0) 编辑
摘要:4.1 Implement a function to check if a binary tree is balanced. For the purposes of this question, a balanced tree is defined to be a tree such that t... 阅读全文
posted @ 2015-07-29 13:11 Grandyang 阅读(783) 评论(0) 推荐(0) 编辑
摘要:3.7 An animal shelter holds only dogs and cats, and operates on a strictly "first in, first out" basis. People must adopt either the "oldest" (based o... 阅读全文
posted @ 2015-07-28 12:59 Grandyang 阅读(775) 评论(0) 推荐(0) 编辑
摘要:Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. Th 阅读全文
posted @ 2015-07-28 12:54 Grandyang 阅读(16423) 评论(8) 推荐(1) 编辑
摘要:在OpenCv中,我们有时候需要查看CvRect变量的值,我们可以通过将其保存到文件来查看,保存的代码如下:void writeCvRectToFile(CvRect &rect, const char *filename) { CvFileStorage *fs = cvOpenFi... 阅读全文
posted @ 2015-07-27 11:32 Grandyang 阅读(673) 评论(0) 推荐(0) 编辑
摘要:3.6 Write a program to sort a stack in ascending order (with biggest items on top). You may use at most one additional stack to hold items, but you ma... 阅读全文
posted @ 2015-07-27 06:14 Grandyang 阅读(3634) 评论(0) 推荐(0) 编辑
摘要:3.5 Implement a MyQueue class which implements a queue using two stacks.LeetCode上的原题,请参见我之前的博客Implement Queue using Stacks 用栈来实现队列。 阅读全文
posted @ 2015-07-27 00:47 Grandyang 阅读(742) 评论(0) 推荐(0) 编辑
摘要:3.4 In the classic problem of the Towers of Hanoi, you have 3 towers and N disks of different sizes which can slide onto any tower. The puzzle starts ... 阅读全文
posted @ 2015-07-26 11:45 Grandyang 阅读(1748) 评论(0) 推荐(0) 编辑
摘要:3.3 Imagine a (literal) stack of plates. If the stack gets too high, it might topple. Therefore, in real life, we would likely start a new stack when ... 阅读全文
posted @ 2015-07-26 08:08 Grandyang 阅读(1169) 评论(0) 推荐(0) 编辑
摘要:3.2 How would you design a stack which, in addition to push and pop, also has a function min which returns the minimum element? Push, pop and min shou... 阅读全文
posted @ 2015-07-25 12:55 Grandyang 阅读(691) 评论(0) 推荐(0) 编辑
摘要:3.1 Describe how you could use a single array to implement three stacks.这道题让我们用一个数组来实现三个栈,书上给了两种方法,第一种方法是定长分割 Fixed Division,就是每个栈的长度相同,用一个公用的一位数组buff... 阅读全文
posted @ 2015-07-25 12:06 Grandyang 阅读(1593) 评论(0) 推荐(0) 编辑
摘要:在Qt中,如果想快速生成一个对话框,可以和用户进行简单的交互,而不需要写一个新的类的时候,就要用到QInputDialog类,这个类就是专门用来建立简单对话框的,其主要能建下列几种对话框:bool ok;double d = QInputDialog::getDouble(this, tr("QIn... 阅读全文
posted @ 2015-07-24 11:17 Grandyang 阅读(19359) 评论(0) 推荐(0) 编辑
摘要:Write an efficient algorithm that searches for a target value in an m x n integer matrix. The matrix has the following properties: Integers in each ro 阅读全文
posted @ 2015-07-23 00:58 Grandyang 阅读(19600) 评论(6) 推荐(1) 编辑
摘要:2.7 Implement a function to check if a linked list is a palindrome.LeetCode上的原题,参见我之前的博客Palindrome Linked List 回文链表。 阅读全文
posted @ 2015-07-22 21:00 Grandyang 阅读(710) 评论(0) 推荐(0) 编辑
摘要:2.6 Given a circular linked list, implement an algorithm which returns the node at the beginning of the loop.DEFINITIONCircular linked list: A (corrup... 阅读全文
posted @ 2015-07-21 20:40 Grandyang 阅读(673) 评论(0) 推荐(0) 编辑
摘要:在Qt中,QAction,QActionGroup 和 QMenu类用用来操作软件的菜单栏的,比如很多软件都有文件菜单,里面有打开,保存,另存为之类的选项,在Qt中就是通过这几个类来实现的。或者是在菜单中实现一些选项设置,多选或单选什么的。具体使用方法如下所示: 阅读全文
posted @ 2015-07-21 07:14 Grandyang 阅读(7541) 评论(0) 推荐(0) 编辑
摘要:在Qt中,我们有时需要把QImage类的彩色图片转为灰度图,一开始我想的是用QImage的成员函数convertToFormat(),但是试了好多参数,返现转化的图片都有问题,不是我们想要的灰度图,如果谁用成员函数成功转化成了灰度图,请在评论区将您的方法写下,让博主学习一下。那么还有一种笨办法,就是... 阅读全文
posted @ 2015-07-21 06:02 Grandyang 阅读(3788) 评论(0) 推荐(0) 编辑
摘要:2.5 You have two numbers represented by a linked list, where each node contains a single digit. The digits are stored in reverse order, such that the ... 阅读全文
posted @ 2015-07-20 20:42 Grandyang 阅读(5817) 评论(1) 推荐(0) 编辑
摘要:2.4 Write code to partition a linked list around a value x, such that all nodes less than x come before all nodes greater than or equal to x.LeetCode上... 阅读全文
posted @ 2015-07-20 12:57 Grandyang 阅读(804) 评论(0) 推荐(0) 编辑
摘要:2.3 Implement an algorithm to delete a node in the middle of a singly linked list, given only access to that node.EXAMPLEInput: the node c from the li... 阅读全文
posted @ 2015-07-19 12:31 Grandyang 阅读(950) 评论(0) 推荐(0) 编辑
摘要:2.2 Implement an algorithm to find the kth to last element of a singly linked list.这道题让我们求链表中倒数第k个元素,LeetCode中相类似的题目有Kth Largest Element in an Array 数... 阅读全文
posted @ 2015-07-19 12:02 Grandyang 阅读(1325) 评论(0) 推荐(0) 编辑
摘要:Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k num 阅读全文
posted @ 2015-07-18 12:09 Grandyang 阅读(37952) 评论(5) 推荐(0) 编辑
摘要:2.1 Write code to remove duplicates from an unsorted linked list.FOLLOW UPHow would you solve this problem if a temporary buffer is not allowed?这道题让我们... 阅读全文
posted @ 2015-07-18 10:55 Grandyang 阅读(1415) 评论(0) 推荐(0) 编辑
摘要:1.8 Assume you have a method isSubstring which checks if one word is a substring of another. Given two strings, s1 and s2, write code to check if s2 i... 阅读全文
posted @ 2015-07-17 06:52 Grandyang 阅读(1518) 评论(0) 推荐(0) 编辑
摘要:1.7 Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column are set to 0.LeetCode中的原题,请参见我之前的博客Set Matrix Zeroes 矩... 阅读全文
posted @ 2015-07-17 06:21 Grandyang 阅读(891) 评论(0) 推荐(0) 编辑
摘要:1.6 Given an image represented by an NxN matrix, where each pixel in the image is 4 bytes, write a method to rotate the image by 90 degrees. Can you d... 阅读全文
posted @ 2015-07-17 05:21 Grandyang 阅读(834) 评论(0) 推荐(0) 编辑
摘要:1.5 Implement a method to perform basic string compression using the counts of repeated characters. For example, the string aabcccccaaa would become a... 阅读全文
posted @ 2015-07-17 03:49 Grandyang 阅读(4266) 评论(0) 推荐(0) 编辑
摘要:1.4 Write a method to replace all spaces in a string with '%20'. You may assume that the string has sufficient space at the end of the string to hold ... 阅读全文
posted @ 2015-07-16 11:41 Grandyang 阅读(1587) 评论(0) 推荐(0) 编辑
摘要:1.3 Given two strings, write a method to decide if one is a permutation of the other.这道题给定我们两个字符串,让我们判断一个是否为另一个的全排列字符串。在LeetCode中,关于排列的题有如下几道,Permutat... 阅读全文
posted @ 2015-07-16 08:47 Grandyang 阅读(1713) 评论(0) 推荐(0) 编辑
摘要:Given an array nums of n integers where n > 1, return an array output such that output[i] is equal to the product of all the elements of numsexcept nu 阅读全文
posted @ 2015-07-16 08:29 Grandyang 阅读(28774) 评论(2) 推荐(5) 编辑
摘要:1.2 Implement a function void reverse(char *str) in C or C++ which reverses a null-terminated string.这道题让我们用C++或C语言来翻转一个字符串,不算一道难题,在之前那道Reverse Words ... 阅读全文
posted @ 2015-07-15 23:03 Grandyang 阅读(1026) 评论(0) 推荐(0) 编辑
摘要:1.1 Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structure?这道题让我们判断一个字符串中是否有重复的字符... 阅读全文
posted @ 2015-07-15 13:13 Grandyang 阅读(3047) 评论(0) 推荐(0) 编辑
摘要:Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 -> 3 - 阅读全文
posted @ 2015-07-15 10:20 Grandyang 阅读(15708) 评论(2) 推荐(0) 编辑
摘要:Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowes 阅读全文
posted @ 2015-07-13 07:10 Grandyang 阅读(28956) 评论(14) 推荐(1) 编辑
摘要:Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia 阅读全文
posted @ 2015-07-12 10:08 Grandyang 阅读(14734) 评论(2) 推荐(0) 编辑
摘要: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 阅读(34173) 评论(10) 推荐(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 阅读(19884) 评论(5) 推荐(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 阅读(13486) 评论(2) 推荐(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 阅读(20989) 评论(5) 推荐(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 阅读(23842) 评论(10) 推荐(2) 编辑
摘要:cvReleaseImage是OpenCV中C语言库中的释放图片内存的函数,比如我们加载或者克隆了一幅图片,当不需要这幅图片了时,我们为了避免内存泄露,需要释放这些空间,可以参见我之前的博客OpenCV Show Image cvShowImage() 使用方法,其使用方法如下:IplImage *... 阅读全文
posted @ 2015-07-02 03:03 Grandyang 阅读(5438) 评论(0) 推荐(0) 编辑
摘要:fc2Image是FlyCapture SDK的C语言库中的图片格式,由于在Windows上的MinGW无法编译FlyCapture2的C++库,只能使用C语言库,所以当我们在同时使用OpenCV的图像格式IplImage时,有时候就需要两种格式相互转换。如果需要FlyCapture2 Image和... 阅读全文
posted @ 2015-07-01 03:12 Grandyang 阅读(2135) 评论(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 阅读(1689) 评论(0) 推荐(0) 编辑

Fork me on GitHub