Arrays & Hashing #
Static Arrays #
Time Complexity #
| Operation | Time Complexity | Notes |
|---|---|---|
| Read | O(1) | |
| Insert | O(n) | If inserting at the end of the array, it’s O(1) |
| Delete | O(n) | If inserting at the end of the array, it’s O(1) |
Dynamic Arrays #
| Operation | Time Complexity | Notes |
|---|---|---|
| Read | O(1) | |
| Insert | O(1) | O(n) if insertion in the middle since shifting will be required |
| Delete | O(1) | O(n) if insertion in the middle since shifting will be required |