remove insert and delete
This commit is contained in:
parent
37ca8ca5bf
commit
9a4de9225d
BIN
homework_11
BIN
homework_11
Binary file not shown.
3
justfile
3
justfile
|
@ -15,7 +15,8 @@ release:
|
||||||
run:
|
run:
|
||||||
cmake -DCMAKE_C_FLAGS="-fstandalone-debug" -DCMAKE_BUILD_TYPE=Debug -C clang-cmakeinit.cmake .
|
cmake -DCMAKE_C_FLAGS="-fstandalone-debug" -DCMAKE_BUILD_TYPE=Debug -C clang-cmakeinit.cmake .
|
||||||
make VERBOSE=1
|
make VERBOSE=1
|
||||||
./homework_11
|
rm a.txt
|
||||||
|
./homework_11 > a.txt
|
||||||
|
|
||||||
mem-test:
|
mem-test:
|
||||||
cmake -DCMAKE_C_FLAGS="-fsanitize=address -fstandalone-debug" -DCMAKE_BUILD_TYPE=Debug -C clang-cmakeinit.cmake .
|
cmake -DCMAKE_C_FLAGS="-fsanitize=address -fstandalone-debug" -DCMAKE_BUILD_TYPE=Debug -C clang-cmakeinit.cmake .
|
||||||
|
|
|
@ -15,8 +15,8 @@ int main()
|
||||||
input(&state);
|
input(&state);
|
||||||
length_distribution(&state);
|
length_distribution(&state);
|
||||||
segment(&state);
|
segment(&state);
|
||||||
prefix_insert(&state);
|
// prefix_insert(&state);
|
||||||
prefix_delete(&state);
|
// prefix_delete(&state);
|
||||||
search(&state);
|
search(&state);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
11
src/v3.c
11
src/v3.c
|
@ -130,9 +130,10 @@ void search(struct State* state){
|
||||||
|
|
||||||
record_start
|
record_start
|
||||||
|
|
||||||
|
freq++;
|
||||||
|
|
||||||
if(reduce_submask(mask)){
|
if(reduce_submask(mask)){
|
||||||
struct Node* ll=hash_pop(state->hashmap,mask);
|
struct Node* ll=hash_pop(state->hashmap,mask);
|
||||||
freq++;
|
|
||||||
|
|
||||||
record_end("search.csv")
|
record_end("search.csv")
|
||||||
|
|
||||||
|
@ -142,13 +143,7 @@ void search(struct State* state){
|
||||||
else printf("failed\n");
|
else printf("failed\n");
|
||||||
hash_insert(state->hashmap,mask,ll);
|
hash_insert(state->hashmap,mask,ll);
|
||||||
}else{
|
}else{
|
||||||
struct Node* ll=state->head;
|
if (xor_contain(state->head,ip,eq_v3)) printf("successful\n");
|
||||||
|
|
||||||
freq++;
|
|
||||||
|
|
||||||
fflush(stdout);
|
|
||||||
|
|
||||||
if (xor_contain(ll,ip,eq_v3)) printf("successful\n");
|
|
||||||
else printf("failed\n");
|
else printf("failed\n");
|
||||||
free(mask);
|
free(mask);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue