自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Rijkstra的专栏

https://github.com/Ray137076517

  • 博客(20)
  • 资源 (18)
  • 收藏
  • 关注

原创 【leetcode】3Sum, 3Sum Closest

Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:Elements in a triplet (a,b,c

2016-06-03 20:42:31 350

原创 【leetcode】Implement strStr()

曾经被百度面试官虐的时候碰到过这题。注意:字符串以'\0'结束,NULL和'\0'不等价。暴力解决:外循环:遍历haystack;内循环:遍历needle,若字符不匹配则跳出,当遍历到needle结束时,返回当前i,若遍历到haystack结束,则不存在匹配子串,返回-1。int strStr(char* haystack, char* needle){ if

2016-06-03 15:00:08 313

原创 【leetcode】Rotate List

Given a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3->NULL.思路:将链表尾部和头部连起来,顺便算出链表长度len计算k

2016-06-02 21:36:50 324

原创 【leetcode】Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "

2016-06-02 21:29:45 316

原创 【leetcode】Minimum Window Substring

class Solution {public: string minWindow(string s, string t) { vector dict(128, 0); for (auto c : t) ++dict[c]; int counter = t.size(); int begin =

2016-06-02 13:49:47 410

原创 【leetcode】Top K Frequent Elements

Given a non-empty array of integers, return the k most frequent elements.For example,Given [1,1,1,2,2,3] and k = 2, return [1,2].Note: You may assume k is always valid, 1 ≤ k ≤ number

2016-05-31 11:53:12 314

原创 【C++】非递归求二叉树的前序和中序序列

Keyword:stack前序:/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right

2015-11-23 22:08:19 501

原创 【leetcode】Valid Number

目前leetcode上AC率最低的一题。第一次实战有限状态机,终于摸到点皮毛了。

2015-11-19 23:28:50 494

原创 【leetcode】Contains Duplicate

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 array, and it should return false if every element

2015-11-19 21:39:03 304

原创 【leetcode】Product of Array Except Self

Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Solve it without division and in O

2015-11-19 21:17:01 307

原创 【leetcode】Best Time to Buy and Sell Stock II

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

2015-11-19 20:35:43 373

原创 【leetcode】Single Number III

Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.For example:Given

2015-11-19 20:01:49 372

原创 【OpenCL】初学摘要(一)

因项目需要,开始真正学习OpenCL了,以下是我所阅读过的所有资料的一个个人的摘要整理,近期持续更新。方便以后自己回顾以及其他同学参考。资料来源:OpenCL编程指南,AMD OpenCL大学课程ppt,OpenCL贴吧。并行任务并行:把一个问题分解为能够同时执行的多个任务。数据并行:同一个任务内,它的各个部分同时执行。多核cpu适合基于任务的并行编程,GPU更适应于数据并行编

2015-03-15 20:54:09 2627

原创 【C++】CLRS上的堆排序实现

N天前照着书上伪代码写的堆排序

2014-10-07 11:43:08 489

原创 【C++】Primer 9.39

#include #include #include #include //EXIT_SUCCESS, FAILUREusing namespace std;int main(){ string line1 = "We were her pride of 10 she named us:"; string line2 = "Benjamin, Phoneix, the Pr

2014-09-15 22:12:49 629

原创 【C++】只为熟悉语言的一个小小练习

原题是C++ Primer()上的习题6.12

2014-08-22 12:27:09 521

原创 【C++】两个关于vector和iterator的练习

在VC6.0里编译会出现4个warningstring容器,所有字母换成大写:

2014-08-11 20:13:11 658

原创 【C】查找关键字所在行,输出位置及该行

C圣经上的例子,看完书自己写了一遍,可以运行。

2014-06-04 13:03:36 2027 1

原创 【C】打印输入中单词长度的直方图(水平)

the C programming language,p17,练习1-13

2014-05-19 11:34:17 1302

原创 the C programming language 练习

p13 ,练习1-9#include void main(){ int c = getchar(); int lastc = 0; while (c != '\n') { if ((c!=' ') || (lastc!=' ')) //输出字符的条件集合 putchar(c); lastc = c; c = getchar(); } putchar('\n'

2014-05-18 21:39:16 810

重构:改善既有代码的设计.pdf

重构:改善既有代码的设计.pdf

2013-07-02

Machine Learning in Action.pdf

Machine Learning in Action.pdf

2013-07-02

集体智慧编程中文版.pdf

集体智慧编程中文版.pdf

2013-07-02

梦断代码.pdf

梦断代码.pdf

2013-07-02

unix-linux编程实践教程.pdf

unix-linux编程实践教程.pdf

2013-07-02

UNIX编程艺术.pdf

UNIX编程艺术.pdf

2013-07-02

莱昂氏UNIX源代码分析.pdf

莱昂氏UNIX源代码分析.pdf

2013-07-02

The Little Schemer

The Little SchemerThe Little SchemerThe Little Schemer

2013-07-02

修改代码的艺术

修改代码的艺术

2013-07-02

汇编语言第2版

汇编语言第2版

2013-07-02

编程珠玑.pdf

编程珠玑

2013-07-02

Thinking In Java 3rd.Edition

Thinking In Java 3rd.Edition

2013-07-01

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除