01 2015 档案

摘要:The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a... 阅读全文
posted @ 2015-01-25 20:47 匡子语 阅读(182) 评论(0) 推荐(0) 编辑
摘要:Given a stringsand a dictionary of wordsdict, add spaces insto construct a sentence where each word is a valid dictionary word.Return all such possibl... 阅读全文
posted @ 2015-01-25 20:00 匡子语 阅读(171) 评论(0) 推荐(0) 编辑
摘要:Given two words (startandend), and a dictionary, find all shortest transformation sequence(s) fromstarttoend, such that:Only one letter can be changed... 阅读全文
posted @ 2015-01-21 22:58 匡子语 阅读(215) 评论(0) 推荐(0) 编辑
摘要:Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2]have the following unique perm... 阅读全文
posted @ 2015-01-21 21:22 匡子语 阅读(169) 评论(0) 推荐(0) 编辑
摘要:Given a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Each number ... 阅读全文
posted @ 2015-01-21 15:17 匡子语 阅读(198) 评论(0) 推荐(0) 编辑
摘要:Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepeated num... 阅读全文
posted @ 2015-01-21 14:08 匡子语 阅读(173) 评论(0) 推荐(0) 编辑
摘要:Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution is:[ [2,4], [3,4], [2,3],... 阅读全文
posted @ 2015-01-20 22:59 匡子语 阅读(228) 评论(0) 推荐(0) 编辑
摘要:Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.思路:题目看上去好像很难,但实际上很简单,递归做就行,每次找到左右子树对应的子链表... 阅读全文
posted @ 2015-01-18 20:17 匡子语 阅读(192) 评论(0) 推荐(0) 编辑
摘要:Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu... 阅读全文
posted @ 2015-01-18 19:55 匡子语 阅读(215) 评论(0) 推荐(0) 编辑
摘要:Sort a linked list using insertion sort.思路:用插入排序对链表排序。插入排序是指每次在一个排好序的链表中插入一个新的值。注意:把排好序的部分和未排序的部分完全分开,指针不要有交叉。 即不会通过->next 重叠class Solution {public: ... 阅读全文
posted @ 2015-01-18 19:33 匡子语 阅读(198) 评论(0) 推荐(0) 编辑
摘要:Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After re... 阅读全文
posted @ 2015-01-17 21:50 匡子语 阅读(171) 评论(0) 推荐(0) 编辑
摘要:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ... 阅读全文
posted @ 2015-01-17 21:10 匡子语 阅读(237) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next level and al... 阅读全文
posted @ 2015-01-17 17:16 匡子语 阅读(201) 评论(0) 推荐(0) 编辑
摘要:A peak element is an element that is greater than its neighbors.Given an input array wherenum[i] ≠ num[i+1], find a peak element and return its index.... 阅读全文
posted @ 2015-01-16 20:58 匡子语 阅读(271) 评论(0) 推荐(0) 编辑
摘要:Given a list of non negative integers, arrange them such that they form the largest number.For example, given[3, 30, 34, 5, 9], the largest formed num... 阅读全文
posted @ 2015-01-16 17:36 匡子语 阅读(260) 评论(0) 推荐(0) 编辑
摘要:Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ... 阅读全文
posted @ 2015-01-16 14:32 匡子语 阅读(156) 评论(0) 推荐(0) 编辑
摘要:想实现书上倒排索引的例子,但是我不会java想用C++写,如果用hadoop streaming 那么输入必须是标准输入的形式, 那么我怎么获得每个文件的文件名呢?查了一下,还有一种方法叫做hadoop pipes 也是可以用来支持C++的,但是怎么用我还不懂 阅读全文
posted @ 2015-01-16 13:48 匡子语 阅读(223) 评论(0) 推荐(0) 编辑
摘要:看了几篇博文,感觉还是云里雾里的。http://blog.csdn.net/opennaive/article/details/7514146http://www.aboutyun.com/thread-6723-1-1.htmlhttp://blog.csdn.net/thomas0yang/ar... 阅读全文
posted @ 2015-01-14 17:12 匡子语 阅读(210) 评论(0) 推荐(0) 编辑
摘要:网上看到的:We want to count all the books in the library. You count up shelf #1, I count up shelf #2. That's map. The more people we get, the faster it goe... 阅读全文
posted @ 2015-01-14 15:49 匡子语 阅读(320) 评论(0) 推荐(0) 编辑
摘要:There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be ... 阅读全文
posted @ 2015-01-13 23:30 匡子语 阅读(205) 评论(0) 推荐(0) 编辑
摘要:Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.思路:我自己的,每次找k个元素的最小的接在答案链表的后面。结果超时了。 ListNode *merge... 阅读全文
posted @ 2015-01-12 22:30 匡子语 阅读(194) 评论(0) 推荐(0) 编辑
摘要:Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the arr... 阅读全文
posted @ 2015-01-09 22:24 匡子语 阅读(222) 评论(0) 推荐(0) 编辑
摘要:Sort a linked list inO(nlogn) time using constant space complexity.思路:用归并排序。设输入链表为S,则先将其拆分为前半部分链表A,后半部分链表B。注意,要把A链表的末尾置为NULL。即要把链表划分为两个独立的部分,防止后面错乱。#i... 阅读全文
posted @ 2015-01-09 22:01 匡子语 阅读(209) 评论(0) 推荐(0) 编辑
摘要:Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, wh... 阅读全文
posted @ 2015-01-08 19:11 匡子语 阅读(223) 评论(0) 推荐(0) 编辑
摘要:Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))... 阅读全文
posted @ 2015-01-08 16:35 匡子语 阅读(200) 评论(0) 推荐(0) 编辑
摘要:The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the total number... 阅读全文
posted @ 2015-01-07 15:43 匡子语 阅读(207) 评论(0) 推荐(0) 编辑
摘要:hadoop通过hadoop streaming 来实现用非Java语言写的mapreduce代码。 对于一个一点Java都不会的我来说,这真是个天大的好消息。官网上hadoop streaming的介绍在:http://hadoop.apache.org/docs/r2.6.0/hadoop-ma... 阅读全文
posted @ 2015-01-07 11:08 匡子语 阅读(5238) 评论(0) 推荐(0) 编辑
摘要:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephon... 阅读全文
posted @ 2015-01-06 14:43 匡子语 阅读(201) 评论(0) 推荐(0) 编辑
摘要:基于视频的目标跟踪,很多人都在做,也有很多文章。可是究竟有什么用途呢?首先,基于视频,这就受限很多。因为计算机始终是没有人智能,基于视频只能是通过一些颜色、纹理之类的信息来跟踪。其准确性十分有限。光是检测出正确目标的可能性就不大,更别说是跟踪准确了。就算跟踪十分准确,那人突然换件衣服,照样难以跟踪。... 阅读全文
posted @ 2015-01-06 12:37 匡子语 阅读(677) 评论(0) 推荐(0) 编辑
摘要:Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioning ofs.For example, giv... 阅读全文
posted @ 2015-01-06 10:49 匡子语 阅读(142) 评论(0) 推荐(0) 编辑
摘要:The set[1,2,3,…,n]contains a total ofn! unique permutations.By listing and labeling all of the permutations in order,We get the following sequence (ie... 阅读全文
posted @ 2015-01-05 21:20 匡子语 阅读(202) 评论(0) 推荐(0) 编辑
摘要:Given a collection of numbers, return all possible permutations.For example,[1,2,3]have the following permutations:[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,... 阅读全文
posted @ 2015-01-05 20:25 匡子语 阅读(186) 评论(0) 推荐(0) 编辑
摘要:不知不觉居然已经写了200多篇随笔了,现在查找的时候经常要翻好久,很不方便。故给自己做个目录~【目录】Leetcode【目录】多线程【目录】linux【目录】python【目录】Qt【目录】processing【目录】 hadoop2.6.0【目录】计算机网络【目录】编程之美【目录】编程题目【目录】... 阅读全文
posted @ 2015-01-02 14:24 匡子语 阅读(503) 评论(0) 推荐(0) 编辑
摘要:数据结构【数据结构】DFS求有向图的强连通分量【数据结构】二叉堆【数据结构】离散事件模拟【数据结构】book3_3 表达式求值3.19【数据结构】红黑树 C语言代码 阅读全文
posted @ 2015-01-02 14:21 匡子语 阅读(192) 评论(0) 推荐(0) 编辑
摘要:其他C++基础练习题(一): 查找最短单词[转帖]海森矩阵(Hessian matrix)(EM算法)The EM Algorithm#ifndef -摘自百度百科【转】CV_EXPORT定义的作用,lib及dll的区别混合高斯模型:opencv中MOG2的代码结构梳理vs2010:fatal er... 阅读全文
posted @ 2015-01-02 14:18 匡子语 阅读(204) 评论(0) 推荐(0) 编辑
摘要:编程题目如何对n个数进行排序,要求时间复杂度O(n),空间复杂度O(1)一个数组是由一个递减数列左移若干位形成的,在这种数组中查找某一个数。☆请修改 append 函数,利用这个函数实现两个非降序链表的并集一串首尾相连的珠子(m 个),有 N 种颜色(N<=10),取出其中一段,要求包含所有 N 中... 阅读全文
posted @ 2015-01-02 14:08 匡子语 阅读(262) 评论(0) 推荐(0) 编辑
摘要:编程之美2.1 二进制数中1的个数2.2 阶乘2.4 1的数目2.5 寻找最大的k个数2.6 精确表达浮点数2.7求最大公约数2.8 找符合条件的整数2.10 求数组中最大的数和最小的数2.12快速寻找满足条件的两个数2.13 子数组的最大乘积2.14 求数组的子数组之和的最大值2.15 子数组之和... 阅读全文
posted @ 2015-01-02 13:58 匡子语 阅读(516) 评论(0) 推荐(0) 编辑
摘要:计算机网络网络层1应用层1 阅读全文
posted @ 2015-01-02 13:51 匡子语 阅读(172) 评论(0) 推荐(0) 编辑
摘要:hadoop2.6.0安装+例子运行数据丢失问题解决通过代码运行程序流程利用Hadoop的 Java API利用JAVA API 实现数据上传 阅读全文
posted @ 2015-01-02 13:50 匡子语 阅读(180) 评论(0) 推荐(0) 编辑
摘要:Processing小代码小代码2小代码3小代码4小代码5 阅读全文
posted @ 2015-01-02 13:48 匡子语 阅读(493) 评论(0) 推荐(0) 编辑
摘要:Qt自己生成ui加入工程C++ GUI Qt4 学习笔记1C++ GUI Qt4 学习笔记2C++ GUI Qt4 学习笔记3C++ GUI Qt4 学习笔记4C++ GUI Qt4 学习笔记5视频播放 阅读全文
posted @ 2015-01-02 13:47 匡子语 阅读(168) 评论(0) 推荐(0) 编辑
摘要:python入门学习(一)入门学习(二)入门学习(三)入门学习(四)入门学习(五)入门学习(六)入门学习(七)入门学习(八)入门学习(九)入门学习(十)Head First Python(五)An Introduction to Interactive Programming in Python(w... 阅读全文
posted @ 2015-01-02 13:45 匡子语 阅读(172) 评论(0) 推荐(0) 编辑
摘要:linux学习1学习2学习3学习4学习5学习6学习7jdk安装配置SSH免密码登陆linux下运行java程序 阅读全文
posted @ 2015-01-02 13:41 匡子语 阅读(131) 评论(0) 推荐(0) 编辑
摘要:多线程学习1学习2学习3学习4学习5学习6学习7学习8学习9学习10学习11学习12学习13学习14 阅读全文
posted @ 2015-01-02 13:38 匡子语 阅读(208) 评论(0) 推荐(0) 编辑
摘要:Leetcode1、动态规划Palindrome Partitioning II(hard) ☆Distinct Subsequences(hard)Edit Distance (hard)Interleaving String (hard)Regular Expression Matching (... 阅读全文
posted @ 2015-01-02 13:29 匡子语 阅读(249) 评论(0) 推荐(0) 编辑
摘要:Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given"25525511135",return["255.2... 阅读全文
posted @ 2015-01-02 12:56 匡子语 阅读(223) 评论(0) 推荐(0) 编辑