Skip to content

Commit

Permalink
fix(book/maps): update time/space complexity values
Browse files Browse the repository at this point in the history
  • Loading branch information
amejiarosario committed May 24, 2020
1 parent 7284619 commit 3c4ef75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions book/content/part03/map.asc
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ As we discussed so far, there is a trade-off between the implementations.
.2+.^s| Data Structure 2+^s| Searching By .2+^.^s| Insert .2+^.^s| Delete .2+^.^s| Space Complexity
^|_Index/Key_ ^|_Value_
| Hash Map (naïve) ^|O(n) ^|O(n) ^|O(n) ^|O(n) ^|O(n)
| Hash Map (optimized) ^|O(1)* ^|O(n) ^|O(1)* ^|O(1)* ^|O(1)*
| Tree Map (Red-Black Tree) ^|O(log n) ^|O(n) ^|O(log n) ^|O(log n) ^|O(log n)
| Hash Map (optimized) ^|O(1) ^|O(n) ^|O(1)* ^|O(1) ^|O(n)
| Tree Map (Red-Black Tree) ^|O(log n) ^|O(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
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 @@ -16,8 +16,8 @@ In this section, we learned about Graphs applications, properties and how we can
| <<part03-graph-data-structures#bst, BST (unbalanced)>> ^|- ^|O(n) ^|O(n) ^|O(n) ^|O(n)
| <<b-self-balancing-binary-search-trees#, BST (balanced)>> ^|- ^|O(log n) ^|O(log n) ^|O(log n) ^|O(n)
| 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(1)*
| <<part03-graph-data-structures#treemap, TreeMap>> (Red-Black Tree) ^|O(log n) ^|O(n) ^|O(log n) ^|O(log n) ^|O(log 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)
|===
Expand Down

0 comments on commit 3c4ef75

Please sign in to comment.