D越来越有玩头了~~感觉一下代码的流畅: 1 module main; 2 3 /** 4 * Imports. 5 */ 6 import std.algorithm; 7 import std.array; 8 import std.datetime; 9 import ...
分类:
其他好文 时间:
2014-07-16 21:12:50
阅读次数:
288
题目:Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the ...
分类:
其他好文 时间:
2014-07-16 19:48:18
阅读次数:
263
Given an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm should have a linear runtime comp...
分类:
其他好文 时间:
2014-07-14 10:01:38
阅读次数:
168
Given an index k, return the kth row of the Pascal's triangle.
For example, given k = 3,
Return [1,3,3,1].
Note:
Could you optimize your algorithm to use only O(k) extra space?
原题链接:https:/...
分类:
其他好文 时间:
2014-07-12 20:43:11
阅读次数:
213
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only constant space. Y...
分类:
其他好文 时间:
2014-07-12 20:39:17
阅读次数:
225
承接前面对whoosh的文章,继续:
写索引文件
下面开始写入索引内容,过程如下:
writer = ix.writer()
writer.add_document(title=u"my document", content=u"this is my document", path=u"/a", tags=u"firlst short", icon=u"/icons/star.p...
分类:
其他好文 时间:
2014-07-12 20:22:08
阅读次数:
342
定义
#ifndef PS_ALGORITHM_H_INCLUDED
#define PS_ALGORITHM_H_INCLUDED
#include
#include
#include
#include "Public_Function.h"
#include "cv.h"
#include "highgui.h"
#include "cxmat.hpp"
#incl...
分类:
其他好文 时间:
2014-07-12 18:01:00
阅读次数:
179
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy on...
分类:
其他好文 时间:
2014-07-12 16:31:50
阅读次数:
192
clc;
clear all;
addpath('E:\PhotoShop Algortihm\Image Processing\PS Algorithm');
Image=imread('4.jpg');
Image=double(Image);
R=Image(:,:,1);
G=Image(:,:,2);
B=Image(:,:,3);
R_G...
分类:
其他好文 时间:
2014-07-10 23:31:20
阅读次数:
296