码迷,mamicode.com
首页 >  
搜索关键字:next permutation    ( 15663个结果
LeetCode -- Linked List Cycle
题目链接题意: 给出单链表, 判断是否存在环.方法就是大步小步...附上代码: 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next...
分类:其他好文   时间:2014-05-20 01:46:54    阅读次数:308
线性表[ACM] (有bug)有待修改
1 #include "iostream" 2 #include "string" 3 using namespace std; 4 5 typedef struct node{ 6 string data; 7 struct node *next; 8 node(str...
分类:其他好文   时间:2014-05-19 22:08:01    阅读次数:368
AC自动机
hdu2222 字符串多模匹配算法 采用kuangbin模板#include #include #include #include #include using namespace std;struct Trie{ int next[500010][26],fail[500010],end[5...
分类:其他好文   时间:2014-05-19 08:36:17    阅读次数:234
KMP超强模板贴一份
while(scanf("%s",str+1)==1){intn=strlen(str+1);next[1]=0;intj=0;for(inti=2;i2#include3#include4#include5#include6#include7#include8usingnamespacestd;9...
分类:其他好文   时间:2014-05-17 18:14:24    阅读次数:270
poj1625Censored!(AC自动机+dp)
链接第一次做这种题目,参考了下题解,相当于把树扯直了做DP,估计这一类题都是这个套路吧。状态方程dp[i][next] = dp[i][next]+dp[i][j] ;dp[i][j]表示长度为i的第J个结点的时候满足题意的num,next为当前j点所能走到的下一个合法的结点。需要用高精度,看到一些...
分类:其他好文   时间:2014-05-17 15:21:52    阅读次数:223
打开已存在 Android项目及常见的问题
Eclipse 打开已存在 Android项目及常见的问题 1、 点击菜单“File”-- "Import",会弹出 Import 对话框:2, 选择“General”—“Existing Projects into Workspace” 后点击“Next”:1、 选择”Browse” 选择项目所在...
分类:移动开发   时间:2014-05-17 14:39:23    阅读次数:291
Algorithms(字典树)
字典树 #ifndef TIRE_H_INCLUDED #define TIRE_H_INCLUDED /* ** 字典树 */ #define MAX 26 typedef struct Node { int num; struct Node* next[MAX]; }Tire; /* ** 创建一个节点 */ Tire* create(void); /* *...
分类:其他好文   时间:2014-05-16 02:52:23    阅读次数:246
单链表的排序 快速排序 归并排序 quicksort mergesort
原理都很简单,关键是某些边界能否正确写对: #include #include using namespace std; class Node { public: int val; Node* next; Node(int val = 0):val(val),next(NULL){ } }; Node* quicksort(Node* head, Node* tai...
分类:其他好文   时间:2014-05-15 20:27:36    阅读次数:296
安装Mysql教程
MySQL5.0安装图解打开下载的mysql安装文件mysql-5.0.27-win32.zip,双击解压缩,运行“setup.exe”,出现如下界面:按“Next”继续选择安装类型,有“Typical(默认)”、“Complete(完全)”、“Custom(用户自定义)”三个选项,我们选择“Custom”,有更多的选项,也方便熟..
分类:数据库   时间:2014-05-15 18:52:58    阅读次数:505
leetCode解题报告5道题(八)
5道题目分别是:【Triangle】、【Pascal's Triangle】、【Pascal's Triangle II 】、【Populating Next Right Pointers in Each Node 】、【Populating Next Right Pointers in Each Node II】,由于有一些题目不需要发一整篇博文来记录,所以就将这些题目以一篇博文5道来记录...
分类:其他好文   时间:2014-05-15 18:19:07    阅读次数:272
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!