Skip to content

Commit

Permalink
fix(book/hashset): update hashset space complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
amejiarosario committed May 24, 2020
1 parent 3c4ef75 commit 0319b29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions book/content/part03/set.asc
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ rehash happens, it will take *O(n)* instead of *O(1)*. A `TreeSet` is always *O(
|===
.2+.^s| Data Structure 2+^s| Searching By .2+^.^s| Insert .2+^.^s| Delete .2+^.^s| Space Complexity
^|_Index/Key_ ^|_Value_
| HashSet ^|- ^|O(n) ^|O(1)* ^|O(1)* ^|O(1)*
| TreeSet ^|- ^|O(n) ^|O(log n) ^|O(log n) ^|O(log n)
| HashSet ^|O(1) ^|- ^|O(1)* ^|O(1) ^|O(n)
| TreeSet ^|O(log n) ^|- ^|O(log n) ^|O(log n) ^|O(n)
|===
{empty}* = Amortized run time. E.g. rehashing might affect run time to *O(n)*.
// end::table[]
Expand Down

0 comments on commit 0319b29

Please sign in to comment.