August 16, 2022August 16, 2022 Maps Space-time complexity Worst Case ScenarioAverage Case ScenarioBest Case Scenario Updating an elementO(n)O(1)O(1) Inserting an elementO(n)O(1)O(1) Deleting an elementO(n)O(1)O(1) Searching for an elementO(n)O(1)O(1) Insert (TreeMap)O(log n)O(log n)O(1) Delete (TreeMap)O(log n)O(log n)O(1) Search (TreeMap)O(log n)O(log n)O(1) Learn more about Code Complexity Algorithm mapsspace complexitytime complexity