亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 源代碼:列舉出所有單詞出現的所有行號:tree.cpp

?? 單詞頻率統計
?? CPP
字號:

/* tree.cpp - Matt Mahoney, mmahoney@cs.fit.edu

This program reads a file (specified on the command line, or from
standard input if no file name is given) and for each word, prints
the first 10 line numbers on which it is found at least once.  A word
is any sequence of letters (a-z).  Upper and lower case are equivalent.
The index is printed to standard output with the words in lower
case, listed alphabetically, one word per line, followed by a list
of up to 10 line numbers (separated by spaces), and ... if the word
appears on more than 10 lines.

This program behaves identical to index.cpp (homework 4), but uses
a Tree<K,V> instead of a map<K,V> for the index.  A Tree is a binary
tree with an index operator like a map, and a method transform(f) which
calls the function f on each key-value pair in order.

To compile: gxx tree.cpp     (g++ 2.95.2)
Or:         bcc32 tree.cpp   (Borland 5.5.1)
*/

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <cctype>
using namespace std;


// A Tree<K,V> associates values of type V with keys of type K like
// a map<K,V>.  The index operator works identically, but the only other
// method is transform(f) which calls a function f(const K&, V&) on each
// key-value pair in order of the keys (ordered by < ).  Trees may not
// be copied or assigned.  A tree is implemented as a binary tree sorted
// by key.

template <class K, class V>
class Tree {
private:
	struct Node {  // Node in a binary tree sorted by key
		K key;  // Data visible to user
		V value;
		Node *left, *right;  // Child pointers (<key, >key)
		Node(const K& k): key(k), value(V()), left(0), right(0) {}
	};
	Node* root;  // Root of the tree
	Tree<K,V>& operator=(const Tree<K,V>&);  // Assignment not allowed
	Tree(const Tree<K,V>&);  // Copy not allowed
	void transform(void f(const K&, V&), Node* branch);
    // Recursively call f on a branch of the tree
	void del(Node* branch);  // Recursively delete branch and it's children
	public:
		Tree(): root(0) {}  // Empty tree
		void transform(void f(const K&, V&)) {transform(f, root);}
		// call f(k,v) on each key k and value v in the Tree, lowest key first
		V& operator[](const K& k);  // Return value with key k, create if needed
		~Tree() {del(root);}  // Delete memory
};

// t[k] returns a value of type V associated with the unique key K in Tree t.
// If no value is associated, a new one is created.  The value may be
// assigned to (like in a map).
template<class K, class V>
V& Tree<K,V>::operator[](const K& k) {
	Node** p=&root;  // Pointer to pointer to current Node being searched
	while (*p) {  // Descend tree searching for k
		if (k < (*p)->key)
			p=&((*p)->left);
		else if ((*p)->key < k)
			p=&((*p)->right);
		else
			return (*p)->value;  // found
	}
	*p=new Node(k);  // not found, create
	return (*p)->value;
}

// Private method to call f(k,v) on branch and its chidren from left to right
template<class K, class V>
void Tree<K,V>::transform(void f(const K&, V&), Node* branch) {
	if (branch) {
		transform(f, branch->left);
		f(branch->key, branch->value);
		transform(f, branch->right);
	}
}

// Private method to recursively delete a branch and its children
template<class K, class V>
void Tree<K,V>::del(Node* branch) {
	if (branch) {
		del(branch->left);
		del(branch->right);
		delete branch;
	}
}

typedef Tree<string, vector<int> > Index;  // Maps words to line numbers

// make_index(in, m) reads from the open istream in until EOF and
// constructs an index into the initialy empty Index m.
// Each entry is a lowercase word mapped to a list of up to 11 unique line
// numbers in ascending order.  (Identical to homework 4).
void make_index(istream& in, Index& m) {
	string word;  // Current word
	char c;       // Current char
	int line=1;   // Line number
	while (in.get(c)) {
		if (isalpha(c))
			word+=tolower(c);
		else if (word.size()>0) {  // End of word?  Store line number.
			vector<int>& v=m[word];
			if (v.size()<11 && (v.size()==0 || v.back()!=line))
				v.push_back(line);
			word="";
		}
		if (c=='\n')
			++line;
	}
}

// Print string s and first 10 elements of vector v (with ... if > 10)
// Replaces the print code in main() from homework 4.
void print(const string& s, vector<int>& v) {
	cout << s;
	for (int i=0; i<int(v.size()) && i<10; ++i)
		cout << " " << v[i];
	if (int(v.size()) >= 10)
		cout << "...";
	cout << "\n";
}

// Identical to homework 4 until the call to m.transform()
int main(int argc, char** argv) {
	
	// Open argv[1] or use cin if absent, and pass to make_index()
	Index m;  // Maps words to a vector of up to 11 unique line numbers
	if (argc>1) {
		ifstream in(argv[1]);
		if (!in) {
			cerr << "File not found: " << argv[1] << endl;
			return 1;
		}
		make_index(in, m);
	}
	else
		make_index(cin, m);
	m.transform(print);  // Print the index
	return 0;
}



?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品亚洲二区| 国产99久久久国产精品潘金| 精品国产乱码91久久久久久网站| 成人av第一页| 蜜桃在线一区二区三区| 国产精品久久久久久妇女6080| 欧美男女性生活在线直播观看| 成人一区二区三区在线观看| 亚洲va欧美va人人爽午夜| 欧美国产欧美亚州国产日韩mv天天看完整 | 欧美午夜精品一区二区蜜桃| 久久99精品视频| 亚洲综合av网| 亚洲欧美综合另类在线卡通| 久久综合九色综合97婷婷女人| 欧美色欧美亚洲另类二区| 成人黄色av电影| 国产成人免费xxxxxxxx| 蜜臀久久99精品久久久画质超高清| 一区二区在线免费| 亚洲欧洲精品一区二区精品久久久| 日韩免费观看高清完整版在线观看| 一本色道**综合亚洲精品蜜桃冫| 国产成人综合精品三级| 久久国产尿小便嘘嘘| 日本欧美肥老太交大片| 亚洲国产精品欧美一二99| 亚洲视频一区二区在线观看| 国产亚洲午夜高清国产拍精品| 日韩欧美一区在线| 欧美一区二区三区免费在线看| 欧美午夜片在线观看| 欧美亚洲日本国产| 51精品视频一区二区三区| 在线不卡中文字幕播放| 91小宝寻花一区二区三区| 激情成人综合网| 激情综合色播五月| 麻豆成人久久精品二区三区小说| 亚洲123区在线观看| 一片黄亚洲嫩模| 亚洲欧美视频在线观看视频| 国产精品成人免费精品自在线观看| 久久精品男人天堂av| 精品福利av导航| 337p日本欧洲亚洲大胆精品| 精品国产成人在线影院| 精品久久久久久久人人人人传媒| 91精品国产高清一区二区三区蜜臀 | 国产精品996| 日本免费在线视频不卡一不卡二| 亚洲精品一二三区| 洋洋成人永久网站入口| 亚洲综合丁香婷婷六月香| 夜夜精品视频一区二区| 亚洲国产视频直播| 偷拍亚洲欧洲综合| 蜜桃av一区二区在线观看 | 五月开心婷婷久久| 久久精品国产精品亚洲红杏| 国内久久婷婷综合| 高清国产午夜精品久久久久久| 99久久伊人久久99| 欧美性大战久久| 欧美一区二区三区影视| 日韩女优电影在线观看| 国产午夜精品福利| 亚洲免费毛片网站| 午夜电影久久久| 韩国精品一区二区| 91小视频免费看| 欧美一级搡bbbb搡bbbb| 国产欧美一二三区| 尤物在线观看一区| 玖玖九九国产精品| av一二三不卡影片| 欧美顶级少妇做爰| 中文字幕成人网| 五月天欧美精品| 国产suv精品一区二区三区| 91美女福利视频| 日韩三区在线观看| 欧美韩日一区二区三区| 亚洲成va人在线观看| 韩国女主播成人在线| 在线免费观看日韩欧美| 日韩欧美一级精品久久| 中文字幕一区二区三| 日韩国产精品久久久| 成人一区二区三区视频在线观看| 欧美久久久久免费| 国产精品网站在线观看| 日韩国产在线一| 99视频热这里只有精品免费| 欧美不卡一区二区三区四区| 亚洲欧美另类久久久精品| 免费成人在线网站| 在线一区二区观看| 欧美激情一区三区| 美女免费视频一区| 欧美亚洲综合久久| 国产精品国产三级国产aⅴ入口| 欧美aaaaaa午夜精品| 99精品欧美一区二区三区小说 | 日韩视频在线一区二区| 尤物av一区二区| 波多野结衣精品在线| 日韩欧美黄色影院| 亚洲v精品v日韩v欧美v专区| 99精品视频中文字幕| 国产日韩欧美一区二区三区综合| 日本不卡一二三区黄网| 欧美午夜宅男影院| 亚洲美女视频一区| 成人开心网精品视频| 亚洲精品一区二区三区影院| 午夜精品一区二区三区电影天堂 | 欧美性xxxxxxxx| 国产精品久久久久天堂| 韩国欧美国产一区| 精品国产a毛片| 蜜桃久久av一区| 日韩欧美色综合网站| 天堂资源在线中文精品| 欧美色精品天天在线观看视频| 成人欧美一区二区三区黑人麻豆 | 欧美亚洲免费在线一区| 亚洲精品福利视频网站| 99vv1com这只有精品| 国产精品家庭影院| 99免费精品在线观看| 国产精品久久久久久福利一牛影视| 国产不卡视频在线播放| www激情久久| 国产精品亚洲人在线观看| 2024国产精品| 亚洲女性喷水在线观看一区| 另类专区欧美蜜桃臀第一页| 91精品国产免费| 午夜视黄欧洲亚洲| 国产精品亚洲午夜一区二区三区 | 日产精品久久久久久久性色| 9色porny自拍视频一区二区| 久久久蜜臀国产一区二区| 久久丁香综合五月国产三级网站| 精品99999| 亚洲精选一二三| av电影一区二区| 精品国产乱码久久久久久闺蜜| 国产一区二区三区四区在线观看| 欧美日韩大陆一区二区| 亚洲一二三专区| 欧美亚洲国产一区二区三区va | 97久久超碰国产精品| 中文字幕不卡一区| 不卡一区中文字幕| 国产精品丝袜一区| 丁香亚洲综合激情啪啪综合| 国产精品久久看| 99久久国产综合精品色伊| 亚洲欧美偷拍卡通变态| 99视频一区二区三区| 午夜亚洲国产au精品一区二区| 欧美日韩精品欧美日韩精品 | 久久精品国产亚洲一区二区三区| 久久夜色精品国产噜噜av| 国产一区二区三区久久久| 国产丝袜欧美中文另类| 9i在线看片成人免费| 国产精品国产馆在线真实露脸| 欧美午夜寂寞影院| 一区二区三区久久久| 欧美视频日韩视频在线观看| 天堂蜜桃91精品| 精品国产一二三区| 国产99一区视频免费| 亚洲欧美视频一区| www.欧美色图| 日韩高清不卡一区| 久久久综合激的五月天| 成人免费视频一区| 亚洲图片欧美视频| 久久久午夜精品理论片中文字幕| 高清日韩电视剧大全免费| 亚洲美女少妇撒尿| 欧美一区二区精美| 久久99日本精品| 国产精品久久综合| 欧美人妖巨大在线| 成人深夜视频在线观看| 亚洲同性gay激情无套| 在线观看国产一区二区| 亚洲成av人片| 国产日韩欧美精品综合| 欧美色手机在线观看| 国产自产高清不卡| 一区二区视频免费在线观看| 欧美成人精品二区三区99精品| 亚洲视频你懂的| 色一区在线观看|