Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
hash_dic.c
Package: leda.tar.gz [view]
Upload User: gzelex
Upload Date: 2007-01-07
Package Size: 707k
Code Size: 0k
Category:
Mathimatics-Numerical algorithms
Development Platform:
MultiPlatform
- #include <LEDA/hash.h>
- int Hash(const string& x) { return (x.length() > 0) ? x[0] : 0; }
- int hash_last(const string& x)
- { int l = x.length();
- return (l > 0) ? x[l-1] : 0; }
- main()
- {
- hash<string,int> D;
- hash<string,int> D1(hash_last);
- hash_item it;
- string s;
- while (cin >> s)
- { it = D.lookup(s);
- if (it==nil) D.insert(s,1);
- else D.change_inf(it,D.inf(it)+1);
- }
- forall_items(it,D) cout << D.inf(it) << " " << D.key(it) << "n";
- return 0;
- }