点击打开链接
二分图匹配,hopcroft-karp
#include
#include
#include
#include
using namespace std;
const int MAXN = 5010;
const int MAXM = 50010;
struct Edge{
int to, next;
}edge[ MAXM ];
int head[ MAXN ], to...
分类:
其他好文 时间:
2014-07-27 11:45:03
阅读次数:
225
队列也是数据结构中比较重要的一种,和栈相反的是,队列是先进先出的,先进队列的可以先出队,跟平时我们排队是一样的。在允许多通道程序运行的计算机系统中,同时几个作业运行。凡是申请输出的作业都从队尾进入队列。
现在用链表实现队列,先定义一个链表结点:
typedef struct QNode
{
int data;
QNode *next;
}QNode,*QueuePtr;给队列定义一个头结点...
分类:
其他好文 时间:
2014-07-27 11:33:22
阅读次数:
212
方法一: 如果安装过homebrew 可以直接通过 homebrew安装,网上有教程。
方法二:
我用的是方法二,直接在官网上下载了 mysql的 安装文件 dmg 然后双击,
1:点击第一个pkg会弹出安装步骤,然后一路next就ok了。 最后就会出现安装完成的tips,如果中间出现问题,请打开 readme.txt进行阅读。
2:第三个pkg的作用就是...
分类:
数据库 时间:
2014-07-27 11:12:22
阅读次数:
252
Compared with I version, the tree could be incomplete. The only difference is that, we connect current node's child to next non-childrenless' node's f...
分类:
其他好文 时间:
2014-07-26 17:02:11
阅读次数:
316
<meta charset=‘utf-8‘ />
<?php
class Hero
{
public $no;
public $name;
public $nickname;
public $next = null;
public function __construct($no=‘‘,$nam...
分类:
其他好文 时间:
2014-07-26 15:42:43
阅读次数:
208
题意:给你一个字符串,求这个字符串首字符到第i个字符为止的子串的最大循环次数k(k>1),若存在,输出i和k.
比如aabaabaabaab,长度为12.
到第2个字符时,a出现2次,到第6个字符时,aab出现了2次,
到第9个字符时,aab出现3次,到第12个字符时,aab出现4次
分析:这个就是求给定字符串的前缀子串(包括整个串)的最大循环次数,根据next数组即可...
分类:
其他好文 时间:
2014-07-26 15:29:12
阅读次数:
236
题意:求给定字符串最大循环次数
思路:根据KMP算法的next数组知,一个长度为n的字符串,
if(n%(n-next[n])==0)
最小循环长度为 L=n-next[n];
最大循环次数为 S=n/L=n/(n-next[n]);...
分类:
其他好文 时间:
2014-07-26 15:28:52
阅读次数:
182
leetcode很多题目都是利用快慢指针来解决题目,下面具体讲解下快慢指针。概念: 快指针在每一步走的步长要比慢指针一步走的步长要多。快指针通常的步速是慢指针的2倍。在循环中的指针移动通常为:faster = faster.next.next, slower = slower.next.应用:1.....
分类:
其他好文 时间:
2014-07-26 09:52:17
阅读次数:
136
<html>
<head>
<meta http-equiv=‘content-type‘ content=‘text/html;charset=utf-8‘ />
</head>
<body>
<h1>约瑟夫问题解决</h1>
<?php
class Child
{
public $no;
public $next = ...
分类:
其他好文 时间:
2014-07-26 03:32:37
阅读次数:
182
随手看到了这篇关于Java到底哪里出了问题的文章,笑傻了23333“Java developers just can’t help themselves it seems - give em an inch, and next thing you know you’re looking at a O...
分类:
编程语言 时间:
2014-07-26 01:28:07
阅读次数:
394