Skip to content

fix(book/maps): update space complexity #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions book/content/part03/map.asc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ include::treemap.asc[]
As we discussed so far, there is a trade-off between the implementations.
(((Tables, Non-Linear DS, HashMap/TreeMap complexities)))

// also on: book/content/part03/time-complexity-graph-data-structures.asc
// tag::table[]
.Time complexity for different Maps implementations
|===
Expand Down
1 change: 1 addition & 0 deletions book/content/part03/set.asc
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ rehash happens, it will take *O(n)* instead of *O(1)*. A `TreeSet` is always *O(

(((Tables, Non-Linear DS, HashSet/TreeSet complexities)))

// also on: book/content/part03/time-complexity-graph-data-structures.asc
// tag::table[]
.Time complexity HashSet vs TreeSet
|===
Expand Down
4 changes: 2 additions & 2 deletions book/content/part03/time-complexity-graph-data-structures.asc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ In this section, we learned about Graphs applications, properties and how we can
| Hash Map (naïve) ^|O(n) ^|O(n) ^|O(n) ^|O(n) ^|O(n)
| <<part03-graph-data-structures#hashmap, HashMap>> (optimized) ^|O(1) ^|O(n) ^|O(1)* ^|O(1) ^|O(n)
| <<part03-graph-data-structures#treemap, TreeMap>> (Red-Black Tree) ^|O(log n) ^|O(n) ^|O(log n) ^|O(log n) ^|O(n)
| <<part03-graph-data-structures#hashset, HashSet>> ^|- ^|O(n) ^|O(1)* ^|O(1)* ^|O(1)*
| <<part03-graph-data-structures#tree-set, TreeSet>> ^|- ^|O(n) ^|O(log n) ^|O(log n) ^|O(log n)
| <<part03-graph-data-structures#hashset, HashSet>> ^|O(1) ^|- ^|O(1)* ^|O(1) ^|O(n)
| <<part03-graph-data-structures#tree-set, 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[]