Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "HashTable.h"
- #include <iostream>
- int hashCode(const std::string &elem) {
- int sum = 0;
- for (int k = 0; k < elem.length(); k++) {
- sum = sum + int(elem[k]);
- }
- return sum;
- }
- int main() {
- HashTable<std::string> tbl(hashCode);
- tbl.add("Hello");
- tbl.add(", My");
- tbl.add("Name");
- tbl.add("is");
- tbl.add("Arthur");
- tbl.add("and");
- tbl.add("it's");
- tbl.add("my");
- tbl.add("fucking");
- tbl.add("shit");
- tbl.add("code");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement