How to achieve prepend and append a dynamic array in amortized O(1) in python
Well append in O(1) is easy, but it seems impossible for me to do append and prepend both in O(1) , if i resize the array in right/left/middle side.
Well append in O(1) is easy, but it seems impossible for me to do append and prepend both in O(1) , if i resize the array in right/left/middle side.