Arrays & Hashing

Arrays & Hashing #

Static Arrays #

Time Complexity #

OperationTime ComplexityNotes
ReadO(1)
InsertO(n)If inserting at the end of the array, it’s O(1)
DeleteO(n)If inserting at the end of the array, it’s O(1)

Dynamic Arrays #

OperationTime ComplexityNotes
ReadO(1)
InsertO(1)O(n) if insertion in the middle since shifting will be required
DeleteO(1)O(n) if insertion in the middle since shifting will be required