Created
August 2, 2020 03:19
-
-
Save EricGustin/01f861913a45d2d7b16b97e8a98cbf96 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Operation Example Big O Time Complexity | |
| Index: dict[k] O(1) | |
| Assign: dict[k] = v O(1) | |
| Length: dict(lst) O(1) | |
| Pop: dict.pop(k) O(1) | |
| Pop item: dict.popitem() O(1) | |
| Get a value: dict.get(k) O(1) | |
| Get keys: dict.keys() O(1) | |
| Clear: dict.clear() O(1) | |
| Construct: dict = dict(keyword arguments) O(length of keyword arguments) | |
| Delete: del dict[k] O(1) | |
| Iteration: for k in dict: O(n) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment