Skip to content

Commit 3c4ef75

Browse files
committed
fix(book/maps): update time/space complexity values
1 parent 7284619 commit 3c4ef75

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

book/content/part03/map.asc

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ As we discussed so far, there is a trade-off between the implementations.
5858
.2+.^s| Data Structure 2+^s| Searching By .2+^.^s| Insert .2+^.^s| Delete .2+^.^s| Space Complexity
5959
^|_Index/Key_ ^|_Value_
6060
| Hash Map (naïve) ^|O(n) ^|O(n) ^|O(n) ^|O(n) ^|O(n)
61-
| Hash Map (optimized) ^|O(1)* ^|O(n) ^|O(1)* ^|O(1)* ^|O(1)*
62-
| Tree Map (Red-Black Tree) ^|O(log n) ^|O(n) ^|O(log n) ^|O(log n) ^|O(log n)
61+
| Hash Map (optimized) ^|O(1) ^|O(n) ^|O(1)* ^|O(1) ^|O(n)
62+
| Tree Map (Red-Black Tree) ^|O(log n) ^|O(n) ^|O(log n) ^|O(log n) ^|O(n)
6363
|===
6464
{empty}* = Amortized run time. E.g. rehashing might affect run time to *O(n)*.
6565
// end::table[]

book/content/part03/time-complexity-graph-data-structures.asc

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ In this section, we learned about Graphs applications, properties and how we can
1616
| <<part03-graph-data-structures#bst, BST (unbalanced)>> ^|- ^|O(n) ^|O(n) ^|O(n) ^|O(n)
1717
| <<b-self-balancing-binary-search-trees#, BST (balanced)>> ^|- ^|O(log n) ^|O(log n) ^|O(log n) ^|O(n)
1818
| Hash Map (naïve) ^|O(n) ^|O(n) ^|O(n) ^|O(n) ^|O(n)
19-
| <<part03-graph-data-structures#hashmap, HashMap>> (optimized) ^|O(1)* ^|O(n) ^|O(1)* ^|O(1)* ^|O(1)*
20-
| <<part03-graph-data-structures#treemap, TreeMap>> (Red-Black Tree) ^|O(log n) ^|O(n) ^|O(log n) ^|O(log n) ^|O(log n)
19+
| <<part03-graph-data-structures#hashmap, HashMap>> (optimized) ^|O(1) ^|O(n) ^|O(1)* ^|O(1) ^|O(n)
20+
| <<part03-graph-data-structures#treemap, TreeMap>> (Red-Black Tree) ^|O(log n) ^|O(n) ^|O(log n) ^|O(log n) ^|O(n)
2121
| <<part03-graph-data-structures#hashset, HashSet>> ^|- ^|O(n) ^|O(1)* ^|O(1)* ^|O(1)*
2222
| <<part03-graph-data-structures#tree-set, TreeSet>> ^|- ^|O(n) ^|O(log n) ^|O(log n) ^|O(log n)
2323
|===

0 commit comments

Comments
 (0)