What is runtime complexity of the list's built-in .append() method?
.append()
O(1), also called constant time.
O(n), also called linear time. This function has constant time complexity i.e. O(1), because lists are randomly accessed so the last element can be reached in O(1) time that's why the time taken to add the new element at the end of the list is O(1).
O(log n), also called logarithmic time.
O(n^2), also called quadratic time.