DeleteRecord implicitly moves the record pointer to the next record in the record set. If a call to NextRecord is made after a call to DeleteRecord th...
分类:
其他好文 时间:
2014-09-17 18:14:22
阅读次数:
187
堆栈类: package?c15; public?class?LinkedStack<T> { ???????private?static?class?Node<T> { ????????????T?item?; ????????????Node<T>?next?; ?????????...
分类:
编程语言 时间:
2014-09-17 12:16:02
阅读次数:
237
在单链表中,每一个结点包含两部分:存放每一个数据元素本身信息的数据域和存放其直接后继存储位置的指针域。
单链表结点的类型描述:
typedef int ElemType;
typedef struct node{
ElemType data;
struct node *next;
}LNode,*LinkList;
单链表的存取必须从头指针开始...
分类:
其他好文 时间:
2014-09-17 12:08:22
阅读次数:
233
题意 有一个键盘坏了 会在你不知道的情况下按下home或者end 给你这个键盘的实际输入 要求输出显示器上的实际显示
输入最大5MB 所以直接数组检索肯定会超时的 用数组模拟链表 就可以很快了
#include
#include
using namespace std;
const int N=100005;
char s[N];
int next[N];
int main()
...
分类:
其他好文 时间:
2014-09-17 12:07:32
阅读次数:
185
// reverselink.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"struct Node{ int num; struct Node*next;};typedef struct Node Node;Node * createLink(){ ...
分类:
其他好文 时间:
2014-09-17 11:55:42
阅读次数:
186
用Iterator模式实现遍历集合
Iterator模式是用于遍历集合类的标准访问方法。它可以把访问逻辑从不同类型的集合类中抽象出来,从而避免向客户端暴露集合的内部结构。
例如,如果没有使用Iterator,遍历一个数组的方法是使用索引:
for(int i=0; i
而访问一个链表(LinkedList)又必须使用while循环:
while((e=e.next())!=nul...
分类:
其他好文 时间:
2014-09-17 10:17:22
阅读次数:
195
首先,学AC自动机之前有必要掌握 Trie 图,KMP。 AC自动机其实和KMP类似,它的fail指针就相当于KMP中的next指针,只不过fail指针是空间上的,而next指针是线上的。fail指针永远都指向层数比它低的对应节点,所 以它有比较多的性质, 比如 一直走fail 最后始终是会走到.....
分类:
其他好文 时间:
2014-09-17 10:08:41
阅读次数:
195
点击打开链接
SPFA + A*
#include
#include
#include
#include
using namespace std;
struct node {
int v, dis, f, next;
friend bool operator b.f;
}
};
const in...
分类:
其他好文 时间:
2014-09-16 23:44:21
阅读次数:
189
迭代器设计模式广泛用于集合中的遍历
这里主要用到了内部类
以下是简化的的一个迭代器的设计模式
1.Iterator接口
public interface Iterator {
boolean hasNext();
E next();
}
2.内部类
public class Outer {
private Object[] item;
private int size ...
分类:
其他好文 时间:
2014-09-16 22:09:01
阅读次数:
217
KMP算法是在已知模式串的next函数值的基础上执行的,此函数值仅取决 于模式串本身而和相匹配的主串无关,相当于离线计算好模式串的next函数值,KMP搜索子串过程中产生“失配”时,保持主串指针不变,通过查表确定next[j],移动模式串的指针到该位置再进行比较。主要是next函数值的确定。...
分类:
编程语言 时间:
2014-09-16 20:40:11
阅读次数:
304