自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(480)
  • 资源 (39)
  • 收藏
  • 关注

转载 leetcode(44) - Wildcard Matching

思路假设我们用两个指针分别指向s和p字符串中要匹配的位置,首先分析下通配符匹配过程中会有哪些情况是成功:s的字符和p的字符相等p中的字符是?,这时无论s的字符是什么都可以匹配一个p中遇到了一个*,这时无论s的字符是什么都没关系之前的都不符合,但是p在之前的位置有一个*,我们可以从上一个*后面开始匹配s已经匹配完,但是p后面还有很多连续的`*

2016-12-01 21:45:00 568

转载 leetcode(43) - Multiply Strings

思路 1 : 这道题属于数值操作的题目,其实更多地是考察乘法运算的本质。基本思路是和加法运算还是近似的,只是进位和结果长度复杂一些。我们仍然是从低位到高位对每一位进行计算,假设第一个数长度是n,第二个数长度是m,我们知道结果长度为m+n或者m+n-1(没有进位的情况)。对于某一位i,要计算这个位上的数字,我们需要对所有能组合出这一位结果的位进行乘法,即第1位和第i-1位,第2位和第i-2位,...

2016-11-30 23:04:31 565

原创 leetcode(42) - Trapping Rain Water

给定n个非负整数,代表一个柱状图,每一个柱子的宽度为1,计算下雨之后柱状图能装多少水?例如:[0,1,0,2,1,0,1,3,2,1,2,1]  返回 6    上述柱状图是由数组表示[0,1,0,2,1,0,1,3,2,1,2,1]。在这种情况下,6个单位的雨水(蓝色部分)被装。对于每个柱子,找到其左右两边最高的柱子,该柱子能容纳的面积就是

2016-11-29 15:28:25 589

转载 深度优先搜索(DFS)

1.前言深度优先搜索(缩写DFS)有点类似广度优先搜索,也是对一个连通图进行遍历的算法。它的思想是从一个顶点V0开始,沿着一条路一直走到底,如果发现不能到达目标解,那就返回到上一个节点,然后从另一条路开始走到底,这种尽量往深处走的概念即是深度优先的概念。你可以跳过第二节先看第三节,:)2.深度优先搜索VS广度优先搜索2.1演示深度优先搜索的过程还是引用上篇文

2016-11-27 23:19:41 560

转载 leetcode(39 40) - Combination Sum I/I I

深度优先搜索(DFS)是搜索算法的一种。最早接触DFS应该是在二叉树的遍历里面,二叉树的先序、中序和后序遍历实际上都属于深度优先遍历,实质就是深度优先搜索,后来在图的深度优先遍历中则看到了更纯正的深度优先搜索算法。       通常,我们将回溯法和DFS等同看待,可以用一个等式表示它们的关系:回溯法=DFS+剪枝。所以回溯法是DFS的延伸,其目的在于通过剪枝使得在深度优先搜索过程中如果满足

2016-11-27 23:01:05 355

转载 leetcode(38) - Count and Say

这是一道根据规则推导题目,要求给定序列数n,求出该序列对应的字符串。 char* countAndSay(int n) { if(n == 1) return "1"; char * cur = malloc(sizeof(char) * 2); char * temp; cur[0] = '1'; cur[1] = '\0';

2016-11-25 21:49:36 353

转载 leetcode(36) - Valid Sudoku 数独

Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the character '.'.A partially fille

2016-11-23 20:03:36 410

原创 leetcode(35) - Search Insert Position

Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.

2016-11-22 21:47:13 331

原创 leetcode(34) - Search for a Range

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 order of O(log n).If the target is not found in

2016-11-22 00:28:33 349

原创 leetcode(33) - Search in Rotated Sorted Array

int find(int* nums, int start, int end, int target) { if (start>end) return -1; int mid=0; while(start <= end){ mid=(start+end)/2; if (nums[mid] < target){

2016-11-21 23:59:38 290

转载 leetcode(32) - Longest Valid Parentheses 最长有效括号对

Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring is "()", which

2016-11-21 21:03:09 350

转载 leetcode(31) - Next Permutation

【题目】Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest

2016-11-18 21:24:56 365

转载 LeetCode(29) - Divide Two Integers

Problem:Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.Solution:不能乘除就加减就行了,但是一个问题是加减有可能速度太慢,因此需要转换,由于任何一个数都能表示成二进制,所以有d

2016-11-17 23:48:43 321

转载 leetCode(30) - Substring with Concatenation of All Words

Problem:You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in wordsexac

2016-11-17 23:46:40 271

原创 leetcode (28) - Implement strStr()

strstr(str1,str2) 函数用于判断字符串str2是否是str1的子串。如果是,则该函数返回str2在str1中首次出现的地址;否则,返回NULL。int strStr(char* haystack, char* needle) { int i = 0, j=0, index=0; int found=0, flag=0;

2016-11-15 16:23:39 396

原创 leetcode(27) - Remove Element

Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in place with constant memory.

2016-11-14 17:16:27 391

原创 leetcode (26) - Remove Duplicates from Sorted Array

Given a sorted array, remove the duplicates in place such that each element appear onlyonce and return the new length.Do not allocate extra space for another array, you must do this in place with

2016-11-13 13:59:16 298

转载 leetcode (25) - Reverse Nodes in k-Group

Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is.

2016-11-13 13:58:01 336

原创 leetcode(24) - Swap Nodes in Pairs

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

2016-11-11 15:53:03 428

转载 leetcode (23) - Merge k Sorted Lists

算法1:最傻的做法就是先1、2合并,12结果和3合并,123结果和4合并,…,123..k-1结果和k合并,我们计算一下复杂度。1、2合并,遍历2n个节点12结果和3合并,遍历3n个节点123结果和4合并,遍历4n个节点…123..k-1结果和k合并,遍历kn个节点总共遍历的节点数目为n(2+3+…+k) = n*(k^2+k-2)/2, 因此时间复杂度是O(n*(k^

2016-11-10 22:07:28 344

原创 leetcode (23) - Merge k Sorted Lists

Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.借用了之前的两个已排序链表合并的代码,再依次遍历所有链表,进行两两合并,方法有点弱智,下篇转载一下别人的想法/** * Definition for singly-linke

2016-11-10 21:59:05 332

转载 leetcode (22) - Generate Parentheses

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:[ "((()))", "(()())", "(())()", "()(())",

2016-11-09 20:43:37 303

转载 linux中fork()函数详解

一、fork入门知识     一个进程,包括代码、数据和分配给进程的资源。fork()函数通过系统调用创建一个与原来进程几乎完全相同的进程,也就是两个进程可以做完全相同的事,但如果初始参数或者传入的变量不同,两个进程也可以做不同的事。    一个进程调用fork()函数后,系统先给新的进程分配资源,例如存储数据和代码的空间。然后把原来的进程的所有值都复制到新的新进程中,只有少数值与原来的进

2016-11-08 14:47:20 230

原创 leetcode (21) - Merge Two Sorted Lists

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists./** * Definition for singly-linked list. * struct L

2016-11-08 09:02:06 222

原创 leetcode (20) - Valid Parentheses

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are all va

2016-11-07 14:37:52 251

转载 leetcode (19) - Remove Nth Node From End of List

/** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */struct ListNode* removeNthFromEnd(struct ListNode* head, int n) { if(head

2016-11-06 11:38:09 186

原创 leetcode (18) - 4Sum

Given an array S of n integers, are there elements a,b, c, and d in S such that a + b +c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note: The solution s

2016-11-06 10:45:11 236

转载 leetcode (17) - Letter Combinations of a Phone Number

void getLetterCom(char** res,char* digits,char* tmp,int index,char map[10][5],int *top){ int i,digit=digits[index]-'0'; char* letters; if(digits[index]==0){ letters=(char*)malloc(si

2016-11-04 13:16:13 266

原创 leetcode (16) - 3Sum Closest

Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exact

2016-11-03 13:15:15 194

转载 leetcode (15) - 3sum

void sort(int *a, int left, int right){ if(left >= right) { return ; } int i = left; int j = right; int key = a[left]; while(i < j) { while(i < j && key <=

2016-11-02 22:33:52 174

原创 leetcode (15) - 3sum

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: The solution set must not contain du

2016-11-02 22:31:32 322

原创 leetcode (14) - Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings.char* longestCommonPrefix(char** strs, int strsSize) { int min_length = 0, min_index=0, i, j,tmp ;

2016-11-01 17:44:19 281

转载 leetcode (13) - ROMAN TO INT

class Solution {public: int romanToInt(string s) { int ret = toNumber(s[0]); for (int i = 1; i < s.length(); i++) { if (toNumber(s[i - 1]) < toNumber(s[i])) {

2016-11-01 16:13:34 225

转载 leetcode (12) - INT TO ROMAN

Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.思路首先,学习一下罗马数字,参考罗马数字罗马数字是最古老的数字表示方式,比阿拉伯数组早2000多年,起源于罗马罗马数字有如下符号:基本字

2016-11-01 13:56:41 170

转载 leetcode (11) - Container With Most Water

题意:在一个坐标系中,给出若干点,每个点做x轴的垂直线,然后求任何两条线形成的容器中能盛下最多水的情况分析:1.O(n^2)的算法,leetcode不给通过2. O(n)的算法,只能定性的分析,还不能形式化证明,这个必须得证明,否则不能保证正确性。定性说明:实际在二维坐标系中形成一个波动序列,从左开始与从右开始在分别到达极值之前,都有可能,之后的取值只有极值点才有可能出现变

2016-10-30 23:12:44 296

转载 leetcode(10) - Regular Expression Matching 正则表达式匹配

. 表示匹配任意字符* 表示匹配0个或多个字符bool isMatch(char* s, char* p) { if (*p == '\0') return *s == '\0'; // next char is not '*', then must match current character if (*(p + 1) != '*') {

2016-10-26 23:42:43 629

原创 leetcode (9) - Palindrome Number 整数回文

bool isPalindrome(int x) { bool is_flag=true; int reverse=0; int tmp=x; while(tmp) { if (reverse > (INT_MAX - tmp%10)/10 ) return false; reverse = revers

2016-10-25 20:06:08 199

原创 leetcode (8) - String to Integer

int myAtoi(char* str) { int length = strlen(str); int ret=0; int i=0; bool handle_flag=true; int plus_flag=0; int minus_flag=0; int ch=0; long ch_long=0;

2016-10-24 22:23:51 244

转载 leetcode (6) - ZigZag Conversion

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P L S I I

2016-10-23 23:16:12 240

转载 leetcode (5) - Longest Palindromic Substring 最长回文子串

问题描述回文串是指这个字符串无论从左读还是从右读,所读的顺序是一样的;简而言之,回文串是左右对称的。现在,对于一个给定的母串abcdedcb可以找出子串a, ded, cdedc, bcdecdb等均是回文串;显然,bcdecdb是其中最长的那一个。但是该如何找出最长的回文子串呢?问题解法最容易想到的依然是穷举法,穷举所有子串,找出是回文串的子串,统计出最长的那一个。

2016-10-23 22:50:09 261

hadoop-core-1.1.2.jar

hadoop-core-1.1.2.jar

2013-12-05

C# office.dll

c# 的office函数库,添加到引用即可使用

2013-12-05

C# Excel函数库 EXCEL.DLL

c# Excel.dll 添加到引用即可使用

2013-12-05

c#和API的帮助文档

c# API帮助大家更好的学习c#,希望对大家有所帮助

2013-02-22

MyEclips快捷键大全

MyEclipse的快捷键开发大全,帮助熟练运用MyEclipse的快捷键

2013-01-25

Dos命令图解教程

DOS的命令图解教程,更加生动活泼,帮助记忆

2013-01-25

MFC的类库帮助文档

MFC的类库详解,对于MFC的开发很有帮助,这个MFC的类库帮助文档很好用

2013-01-25

MyEclipse8.5注册机自动产生序列号

MyEclipse8.5的注册机,自动产生序列号,以后可以终身使用MyEclipse8.5,不会再出现提示购买。

2013-01-25

tsp的贪心回溯算法

TSP是当下一个热门问题。希望对大家有所帮助。

2012-05-14

Tsp的算法求解

TSP问题是当下的一个热门问题,如何能用最短路径走完全部的城市。希望对大家有所帮助。

2012-05-14

gis中最短路径算法的实现

GIS中最短路径算法的实现,希望对大家有所帮助、

2012-04-24

最短路径的开题报告

最短路径问题是经常研究的一例问题,经常作为论文布置下来研究,本文是论文的开题报告,希望对大家有所帮助。

2012-04-24

最短路径例子分析

该文章介绍了有关最短路径求解的例子,更容易理解最短路径算法的实现,希望对大家能有所帮助。

2012-04-24

最短路径的求解及其应用问题

最短路径问题是当前最经常遇到的问题,希望对大家能有所帮助。

2012-04-24

校园道路网的最短路径求解

基于校园道路网的最短路径求解问题是当前经常遇到的一个课题,希望对大家能有所帮助。

2012-04-24

如何用floyd算法来求最短路径问题

floyd算法是求解最短路径的一种经典算法,本文分析了它求解最短路径的具体实现方法和效率,希望对大家对floyd算法有所了解。

2012-04-24

最短路径算法的分析与总结

最短路径算法有很多种,本文主要是对各种不同的最短路径算法进行分析比较它们的效率和资源利用率等,希望对大家的学习有所帮助。

2012-04-24

迪杰斯特拉算法的优化

迪杰斯特拉算法可以基于某一载体进行优化,本文主要是基于城市道路载体,希望对大家能有帮助。

2012-04-24

迪杰斯特拉的算法分析与实现

迪杰斯特拉算法是求一个源点到其余各个定点的最短路径的长度

2012-04-24

CSS揭秘 中文PDF

CSS揭秘,中文PDF,LEA VEROU著,CSS魔法译,人民邮电出版社。豆瓣评分9.3,学习CSS的好书,免积分下载。

2017-01-16

《Bootstrap实战》随书源码 (李松峰译,只有源码,不含PDF)

《Bootstrap实战》随书源码,David Cochran著,李松峰译,人民邮电出版社。压缩包里只有源码,没有电子书PDF。

2017-01-16

leetcode算法题答案PDF

leetcode算法题的答案PDF,C++编写的,有详细的算法逻辑分析。

2016-10-14

北风网李炎恢jquery视频的讲义PDF+代码

北风网李炎恢jquery视频的讲义PDF和相应的课堂代码(没有视频)。 如果有小伙伴不喜欢看视频,根据PDF做相应的练习,也可以学到很多东西,效果是一样的。

2016-10-14

北风网李炎恢javascript视频的讲义PDF

北风网李炎恢javascript视频讲义PDF(不是视频)。 如果有小伙伴不喜欢看视频,可以看视频讲义PDF,相应的做一些练习,效果也是一样的\(^o^)/~

2016-10-14

Delicious标签数据集

Delicious标签数据集 , 每一条是一个三元组(用户,url, 标签),可用于标签推荐系统的研究以及数据挖掘方向的研究。

2014-04-21

jdk1.6.0 _13.z01 (对应hadoop 0.20.0版本)

jdk1.6.0_13.z01 (对应hadoop0.20.0版本) 希望对大家对hadoop平台的搭建有帮助, 不同的hadoop都有一个最适合的jdk版本

2014-04-15

hadoop-0.20.2.tar.gz

hadoop-0.20.2.tar.gz 在Linux下解压 现在的书籍基本上都是这个版本的hadoop讲解,希望对大家有帮助

2014-04-15

W3school.chm 帮助文档

W3school.chm 帮助文档,学习web前端的最好的帮助文档

2014-01-08

HTML入门与提高.CHM

HTML入门与提高.CHM 帮助文档

2014-01-08

轻量级Java_EE企业应用实战_(第三版).part5.rar

轻量级Java_EE企业应用实战_(第三版) 一共有5个part 轻量级Java_EE企业应用实战_(第三版).part1.rar 轻量级Java_EE企业应用实战_(第三版).part2.rar 轻量级Java_EE企业应用实战_(第三版).part3.rar 轻量级Java_EE企业应用实战_(第三版).part4.rar 轻量级Java_EE企业应用实战_(第三版).part5.rar 请这个5个part全部下载完了,再解压

2014-01-08

轻量级Java_EE企业应用实战_(第三版).part4.rar

轻量级Java_EE企业应用实战_(第三版) 一共有5个part 轻量级Java_EE企业应用实战_(第三版).part1.rar 轻量级Java_EE企业应用实战_(第三版).part2.rar 轻量级Java_EE企业应用实战_(第三版).part3.rar 轻量级Java_EE企业应用实战_(第三版).part4.rar 轻量级Java_EE企业应用实战_(第三版).part5.rar 请这个5个part全部下载完了,再解压

2014-01-08

轻量级Java_EE企业应用实战_(第三版).part3.rar

轻量级Java_EE企业应用实战_(第三版) 一共有5个part 轻量级Java_EE企业应用实战_(第三版).part1.rar 轻量级Java_EE企业应用实战_(第三版).part2.rar 轻量级Java_EE企业应用实战_(第三版).part3.rar 轻量级Java_EE企业应用实战_(第三版).part4.rar 轻量级Java_EE企业应用实战_(第三版).part5.rar 请这个5个part全部下载完了,再解压

2014-01-08

轻量级Java_EE企业应用实战_(第三版).part2.rar

轻量级Java_EE企业应用实战_(第三版) 一共有5个part 轻量级Java_EE企业应用实战_(第三版).part1.rar 轻量级Java_EE企业应用实战_(第三版).part2.rar 轻量级Java_EE企业应用实战_(第三版).part3.rar 轻量级Java_EE企业应用实战_(第三版).part4.rar 轻量级Java_EE企业应用实战_(第三版).part5.rar 请这个5个part全部下载完了,再解压

2014-01-08

轻量级Java_EE企业应用实战_(第三版).part1.rar

轻量级Java_EE企业应用实战_(第三版) 一共有5个part 轻量级Java_EE企业应用实战_(第三版).part1.rar 轻量级Java_EE企业应用实战_(第三版).part2.rar 轻量级Java_EE企业应用实战_(第三版).part3.rar 轻量级Java_EE企业应用实战_(第三版).part4.rar 轻量级Java_EE企业应用实战_(第三版).part5.rar 请这个5个part全部下载完了,再解压

2014-01-08

lucene-core-3.4.0.jar

lucene-core-3.4.0.jar ,里面关于apache搜索引擎lucence的一些调用类

2013-12-05

commons-configuration-1.6.jar

commons-configuration-1.6.jar ,apache的一些类里面都有

2013-12-05

activation-1.1.jar

activation-1.1.jar,很多类可以调用

2013-12-05

基于Nutch技术的主题搜索引擎实现_李东海.caj

基于Nutch技术的主题搜索引擎实现_李东海.caj

2013-12-05

空空如也

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

TA关注的人

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