Commits

Kelvin Jin committed 178d171

fixed minor error in add function. add/find/mem/remove do not meet runtime requirements?

Comments (0)

Files changed (1)

   let index = hash_function key mod capacity in
   let val_list = Array.get hash_table index in
   let filter lst (k, v) =
-    if v = value then (length := !length - 1; lst)
+    if k = key then (length := !length - 1; lst)
     else (k, v)::lst in
   let processed_val_list = List.rev (List.fold_left filter [] val_list) in
   length := !length + 1;