Skip to content
Snippets Groups Projects
Commit f91aa980 authored by Pavel Veselý's avatar Pavel Veselý
Browse files

new semester cleanup

parent f985c814
Branches
No related tags found
No related merge requests found
Showing
with 0 additions and 869 deletions
This diff is collapsed.
Implement Cuckoo hash table with simple tabulation hashing.
You are given a skeleton code which defines the table, implements
`lookup()`, and provides hash functions. You have to add an `insert()`
method.
If too many elements are moved during a single insert, the table must
be rehashed with new hash functions. See lecture notes for the particular
bounds.
The size of the table should stay constant
throughout the existence of the data structure.
Source code templates can be found in [git](https://gitlab.kam.mff.cuni.cz/datovky/assignments/-/tree/master).
\ No newline at end of file
test: find_duplicates_test
./$<
INCLUDE ?= .
CXXFLAGS=-std=c++11 -O2 -Wall -Wextra -g -Wno-sign-compare -I$(INCLUDE)
find_duplicates_test: find_duplicates_test.cpp find_duplicates.h test_main.cpp
$(CXX) $(CXXFLAGS) $(filter %.cpp,$^) -o $@
clean:
rm -f find_duplicates_test
.PHONY: clean test
#include <unordered_map>
vector<string> find_duplicates(DataGenerator& generator) {
/*
* Find duplicates in the given data.
*
* The `generator` provides a forward iterator over strings
* for traversing the data, so it can be iterated for example
* using a `for` cycle:
*
* for (const string& item : generator) {...}
*
* The `generator` can be traversed multiple times.
*
* The goal is to return a vector of duplicated entries,
* reporting each duplicated entry only once.
*/
return vector<string>();
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment