From 3c4ef7555c400828fb89339184294feb7169b215 Mon Sep 17 00:00:00 2001 From: Adrian Mejia Date: Sun, 24 May 2020 06:36:45 -0400 Subject: [PATCH] fix(book/maps): update time/space complexity values --- book/content/part03/map.asc | 4 ++-- book/content/part03/time-complexity-graph-data-structures.asc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/book/content/part03/map.asc b/book/content/part03/map.asc index 44b15eba..b32802fb 100644 --- a/book/content/part03/map.asc +++ b/book/content/part03/map.asc @@ -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[] diff --git a/book/content/part03/time-complexity-graph-data-structures.asc b/book/content/part03/time-complexity-graph-data-structures.asc index 739ef4d1..620171ed 100644 --- a/book/content/part03/time-complexity-graph-data-structures.asc +++ b/book/content/part03/time-complexity-graph-data-structures.asc @@ -16,8 +16,8 @@ In this section, we learned about Graphs applications, properties and how we can | <> ^|- ^|O(n) ^|O(n) ^|O(n) ^|O(n) | <> ^|- ^|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) -| <> (optimized) ^|O(1)* ^|O(n) ^|O(1)* ^|O(1)* ^|O(1)* -| <> (Red-Black Tree) ^|O(log n) ^|O(n) ^|O(log n) ^|O(log n) ^|O(log n) +| <> (optimized) ^|O(1) ^|O(n) ^|O(1)* ^|O(1) ^|O(n) +| <> (Red-Black Tree) ^|O(log n) ^|O(n) ^|O(log n) ^|O(log n) ^|O(n) | <> ^|- ^|O(n) ^|O(1)* ^|O(1)* ^|O(1)* | <> ^|- ^|O(n) ^|O(log n) ^|O(log n) ^|O(log n) |===