This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ========================================================= | |
* Filename: ADT_tree.c | |
* Description: 数据结构之树 | |
* | |
* ========================================================= | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
问题:有文档集合D,给定词汇t1,t2,我想知道同时包含t1 t2的文档有哪些? | |
问题转化为,倒排索引表上的交,并,差 运算。结合Weien图 | |
倒排索引的由来: | |
所谓倒排就是某个词在哪些文档中出现,正好与一个文档中包含哪些词相反。 | |
词汇-文档矩阵包含上述两个概念。 | |
倒排表的交运算 | |
L1={ai},L2={bi} ;L1 L2均有序,现求L1 ∩ L2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ========================================================= | |
* Filename: rails.c | |
* Description: 判断一个出栈序列能不能从1,2,3,..,n 经过栈处理后生成。 | |
* | |
* ========================================================= | |
*/ | |
#include <stdio.h> | |
#define MAX 1010 | |
int main(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ========================================================= | |
* Filename: throwcards.c | |
* Description: google Throwing cards away I | |
* 题目大意:给n张牌,放成一叠,从上到下编号从1到n,当至少还有两张牌时 | |
* 丢弃最上面的牌,然后把新的最上面的牌放到最下面,一直重复,直到只剩下一张牌 | |
* 输出丢弃牌的序列。 | |
* ========================================================= | |
*/ | |
#include <stdio.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding=utf-8 | |
import re | |
import os | |
import nltk | |
import math | |
from nltk.corpus import stopwords | |
stopword=stopwords.words('english') | |
traindir='./train' | |
testdir='./test' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
项目目标: | |
实现文本分类:分类体系为财经、科技、汽车、房产、体育、娱乐、其它类 | |
,利用网站的新闻主页,训练一个分类器。能够实现新的网页的分类。 | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#define START 1 | |
#define END 10 | |
#define TEST 10 | |
#define TIMES 100000 | |
int main(){ | |
srand(time(NULL)); | |
float sum; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#define STACKSIZE 10 /* 用栈存储不满足条件数,下一次输入从栈开始 */ | |
#define QUEUESIZE 100 /* 用队列存储输入 */ | |
#define N 100 /* 存储输出结果的数组大小 */ | |
#define Emptystack(s) s.top==0 | |
#define Emptyqueue(q) q.count==0 | |
#define GAP 2 | |
/*--------------------------------------------------- | |
* 栈操作:声明栈sta 及相应的压栈 出栈操作 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ========================================================= | |
* Filename: maze.c | |
* Description: backtracking to find a path in maze | |
* refer: http://blog.csdn.net/synapse7/article/details/14411365 | |
* ========================================================= | |
*/ | |
#include <stdio.h> | |
#include <time.h> | |
#include <stdlib.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ========================================================= | |
* Filename: calculator.c | |
* Description: deal with expression like this (4+2)*5-6/(2+1) | |
* number , + - * / , () | |
* 1.convert in-order to post-order | |
* 2.you know how to compute post-order expr | |
* | |
* ========================================================= | |
*/ |