Skip to content

Commit

Permalink
fix(book/maps): update space complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
amejiarosario committed May 24, 2020
1 parent 0319b29 commit 0be0176
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions book/content/part03/map.asc
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
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
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[]

0 comments on commit 0be0176

Please sign in to comment.