Skip to content

Commit 0319b29

Browse files
committed
fix(book/hashset): update hashset space complexity
1 parent 3c4ef75 commit 0319b29

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

book/content/part03/set.asc

+2-2
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ rehash happens, it will take *O(n)* instead of *O(1)*. A `TreeSet` is always *O(
220220
|===
221221
.2+.^s| Data Structure 2+^s| Searching By .2+^.^s| Insert .2+^.^s| Delete .2+^.^s| Space Complexity
222222
^|_Index/Key_ ^|_Value_
223-
| HashSet ^|- ^|O(n) ^|O(1)* ^|O(1)* ^|O(1)*
224-
| TreeSet ^|- ^|O(n) ^|O(log n) ^|O(log n) ^|O(log n)
223+
| HashSet ^|O(1) ^|- ^|O(1)* ^|O(1) ^|O(n)
224+
| TreeSet ^|O(log n) ^|- ^|O(log n) ^|O(log n) ^|O(n)
225225
|===
226226
{empty}* = Amortized run time. E.g. rehashing might affect run time to *O(n)*.
227227
// end::table[]

0 commit comments

Comments
 (0)