From 6f1dd0651573e1d8dadffc200da893032e29bf36 Mon Sep 17 00:00:00 2001 From: marina <138340846+bt3gl-cryptographer@users.noreply.github.com> Date: Mon, 7 Aug 2023 20:31:35 -0700 Subject: [PATCH] Update README.md --- sets/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sets/README.md b/sets/README.md index 5797a73..2259368 100644 --- a/sets/README.md +++ b/sets/README.md @@ -17,7 +17,7 @@ * **array lists**: we would have `O(N)` with `delete`. the solution would be delete the last value (first swap the element to delete with the last one, then pop the last element out). for that, we need to compute an index of each element in `O(N)`, and we need a hashmap that stores `element -> index`. * either way, we need the same combination of data structures: a hashmap and an array. - * an array keeps the values appended in order. `deletes` always replace elements to the end. + * an array keeps the values appended in order. `delete` always replace elements to the end. * an dictionary maps the values (key) to the corresponding length of the array (their index) so it guarantees `O(1)` lookup and provide a list for `random.choice()`.