Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 100,0...
分类:
其他好文 时间:
2014-06-03 05:30:23
阅读次数:
394
ledisdb是一个用go实现的基于leveldb的高性能nosql数据库,它提供多种数据结构的支持,网络交互协议参考redis,你可以很方便的将其作为redis的替代品,用来存储大于内存容量的数据(当然你的硬盘得足够大!)。同时ledisdb也提供了丰富的api,你可以在你的go项目中方便嵌入,作为你app的主要数据存储方案。与redis的区别ledisdb提供了类似redis的几种数据结构,包...
分类:
数据库 时间:
2014-06-03 05:29:45
阅读次数:
309
1.互满数
#include
#include
int fun(int n);
int main(void)
{
int x, y;
for(x = 1; x
{
for(y = 1; y
{
if(fun(x) == y && fun(y) == x)
printf("%d %d\t", x, y);
}
}
return 0;
}
...
分类:
编程语言 时间:
2014-06-03 03:28:21
阅读次数:
274
1.判断一个数是都是回文数
#include
int main(void)
{
int a[100] = {0};
int n;
printf("input n:");
scanf("%d", &n);
int i, k, j;
k = 0;
j = 0;
while(n != 0)
{
a[k++] = n % 10;
n = n / 10;
j+...
分类:
编程语言 时间:
2014-06-03 03:26:18
阅读次数:
255
J - Tree
Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld
& %llu
Submit Status
Appoint description:
System Crawler (2014-05-16)
Description
Tree
...
分类:
其他好文 时间:
2014-06-03 03:06:52
阅读次数:
359
三分查找:
#include
#define M 10
int main(void)
{
int front, near, mid1, mid2;
int n;
int found;
int a[M] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
front = 0;
near = M - 1;
found = 0;
printf("input n:");...
分类:
编程语言 时间:
2014-06-03 01:38:47
阅读次数:
399
1.链表分类
通过线性表概述,我们知道了链表这样一种数据结构,它又分成三类,分别是
单向链表循环链表双向链表
单向链表
单向链表的指针域只有一个指向下一个节点的指针,需要注意几点:
1.头指针——指向第一个节点
2.最后一个结点的指针指向NULL
3.头结点——在链表的第一个结点之前附设一个结点,它的数据域为空
所以,我们看到:
单向链表为空的链表...
分类:
其他好文 时间:
2014-06-03 01:05:56
阅读次数:
311
基本概念
串(字符串)
由0个或多个字符组成的有限序列,例如s="hello world"
串名
上例中的s
子串
某串任意连续字符组成的子序列,称为此字符串的子串
空串
0个字符的串,s=""
空格串
由一个或多个字符组成的串
模式匹配算法
...
分类:
其他好文 时间:
2014-06-02 23:28:56
阅读次数:
305
哈希表的链地址法来解决冲突问题将所有关键字为同义词的记录存储在同一个线性链表中,假设某哈希函数产生的哈希地址在区间[0, m -
1]上,则设立一个至振兴向量Chain ChainHash[m];数据结构//链表结点typedef struct _tagNode{ int data;
...
分类:
其他好文 时间:
2014-05-31 19:23:52
阅读次数:
436