Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5388e50

Browse files
fix(book/hashset): update hashset space complexity
1 parent 3c4ef75 commit 5388e50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎book/content/part03/set.asc

Lines changed: 2 additions & 2 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /