Yes, you are right, it is O(n) where n - length of list. Look here for more information: https://www.ics.uci.edu/~pattis/ICS-33/lectures/complexitypython.txt

Answer from Serenity on Stack Overflow
🌐
Scaler
scaler.com › home › topics › python list reverse()
Python List reverse() - Scaler Topics
May 7, 2024 - Time Complexity: O · ( l · o · g · 2 · ( n · ) ) O(log2(n))O(log2(n)) Space Complexity: O · ( 1 · ) O(1)O(1) The reversed() function returns an iterator that accesses the given sequence in the reverse order.
🌐
Reddit
reddit.com › r/algorithms › time complexity of python a[::-1]
r/algorithms on Reddit: Time complexity of Python a[::-1]
November 29, 2020 -

a[::-1] traverse array a of size n in backward order. What'd be the time complexity of this?

Top answer
1 of 1
12
A previously present answer of O(n) is the only one here, and while I agree that it is a sane answer, I've done some benchmarking in iPython and it seems that a[::-1] is significantly slower than using the reversed() builtin: In [14]: a = list(range(0, 1000000)) In [15]: %timeit a[::-1] 4.85 ms ± 41.4 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) In [16]: %timeit reversed(a) 70.6 ns ± 0.592 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each) This leads me to believe that using the stepped slice operator isn't "smart" enough to use a typical reversing algorithm. Tested with Python v3.8.5 and iPython v7.13.0 Edit: A big thank you to all the comments below showing the flaw in my calculations. Reversed does indeed return an iterator. For those not versed in Python, this means that the reversed result is not an in-memory list, but is instead a code-only representation of the list that can be interacted with as if the list existed (to a degree, there are things iterators cannot do). Since Python doesn't need to read list a to create the iterator, we've failed to test the run time of creating a reversed list using this method. I have repeated my benchmarks but instead forced a list to be constructed of the reversed iterator. Following on from u/spyr03 's comment, I have also used three sizes of list and included the creation of a copy without reversing in order to make a deduction on the complexity used in each method. The results: In [1]: a = list(range(0, 1_000_000)) In [2]: b = list(range(0, 10_000_000)) In [3]: c = list(range(0, 100_000_000)) In [4]: %timeit list(a) 4.82 ms ± 82.1 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) In [5]: %timeit a[::-1] 4.53 ms ± 44.8 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) In [7]: %timeit list(reversed(a)) 6.68 ms ± 166 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) In [8]: %timeit list(b) 58.1 ms ± 165 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) In [9]: %timeit b[::-1] 57.4 ms ± 146 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) In [10]: %timeit list(reversed(b)) 82.6 ms ± 681 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) In [11]: %timeit list(c) 723 ms ± 32.7 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) In [12]: %timeit c[::-1] 749 ms ± 11.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) In [13]: %timeit list(reversed(c)) 958 ms ± 36.1 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) Conclusions that can be made: reversed() is consistently slower than a straight copy and a reversed copy using slicing. My suspicion is that this is caused by overhead of the iterator. A straight copy and a sliced reverse copy take approximately the same amount of time. Increasing the list size by 10 increases the run-time of each method by approximately 10. We can therefore deduce that all three methods have a runtime of O(n), with the reversed() operator having a larger constant factor than the other methods.
People also ask

When should I use NumPy to reverse a list instead of native Python methods?
NumPy is particularly useful for working with numerical data and multi-dimensional arrays. Use NumPy when you need to reverse NumPy arrays or when you require specialized array operations.
🌐
upgrad.com
upgrad.com › home › tutorials › software & tech › how to reverse a list in python?
Reversing a List in Python
What is the time complexity of the two-pointer approach?
The two-pointer approach has a time complexity of O(n/2), where n is the length of the list. This approach is linear in time.
🌐
upgrad.com
upgrad.com › home › tutorials › software & tech › how to reverse a list in python?
Reversing a List in Python
Are there any trade-offs between using built-in functions and manual methods to reverse a list?
Built-in functions like reverse() and reversed() are often more concise and easy to use, while manual methods provide more control and can be more educational for beginners.
🌐
upgrad.com
upgrad.com › home › tutorials › software & tech › how to reverse a list in python?
Reversing a List in Python
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-reversed-vs-1-which-one-is-faster
Python - reversed() VS [::-1] , Which one is faster? - GeeksforGeeks
July 15, 2025 - Additionally, A[::-1] has a slightly lower space complexity, making it a more efficient choice for reversing strings with large input sizes. Moreover, the A[::-1] function is easier to read and understand, which can be beneficial in many applications. Ultimately, the best choice of function will depend on the specific needs of the application, but A[::-1] is generally a faster and more straightforward option for reversing strings, especially with large inputs.
🌐
Codecademy
codecademy.com › article › how-to-reverse-a-list-in-python
How to Reverse a List in Python | Codecademy
Learn how to concatenate lists in Python using `+`, `*`, `for` loop, list comprehension, `extend()`, and `itertools.chain()`. Compare the methods for their efficiency. ... Learn multiple methods for reversing a string in C++, from basic manual approaches (like loops, recursion, stacks) to using STL (Standard Template Library) functions, and compare their performance.
🌐
Mimo
mimo.org › glossary › python › list-reverse-method
Python List reverse() Method: Syntax, Methods, and Examples
Python · Open in Mimo · Open in Mimo · Copy Code · letters = ['a', 'b', 'c'] print("Before:", letters) letters.reverse() print("After:", letters) # Output: ['c', 'b', 'a'] The reverse() method is fast and memory efficient since it doesn’t create a new list. Time Complexity: O(n) Space ...
🌐
Reddit
reddit.com › r/learnpython › why is list.reverse() an o(n) operation?
r/learnpython on Reddit: Why is list.reverse() an O(n) operation?
April 7, 2022 -

I'm still thinking in the mentality of how this could be done in C, and it seems like Python should have a way to play with the indexes in reverse order under the hood to make this operation O(1), so why is reversing a list O(n)? Or at least in CPython

I'm aware that iterating through said reversed list is at least O(n) anyway.

Top answer
1 of 9
19
Well, because it's an in-place operation on a list (not an array). Indexing tricks work great up until the next append operation or similar. There's the built-in reversed which gives you a reverse-order iterator (and as such is O(1), naturally).
2 of 9
14
Because it actually reverses the order of the elements in ram. This cannot be faster than O(n), because it necessarily requires putting what used to be at position 0 in position n-1, 1 in position n-2, etc. It may be that in at least some situations you don't actually need to reverse the position of things in ram, and can just iterate through things backwards and convert l[i] to l[n-i-1] when indexing directly. Lists don't do this. One potential reason is that it would make things like list.append and list.extend weird. As it is now, lists will often have reserved space at the end of their memory block for things to be appended to to make that operation more efficient, but if you suddenly declare that the old end of the list is now the beginning, that extra space is now at the beginning. You could write code so that the O(n) reversal was delayed until necessary (or do extra fancy indexing, where 0 is the old end, n-1 is the old beginning, and n is to the right of 0 - but this wouldn't be worth it enough to bake the pain of dealing with it into such a basic type, I think), but this would complicate the behavior of lists under the hood in a way that they decided not to do. Especially since if you don't actually need the list reversed, but just want to iterate through it backwards, then you can just iterate through it backwards without reversing it at all. As I think about it, I don't think I've ever reversed a python list. But note that numpy arrays do use fancy indexing tricks like this, because while you can pretty easily do such things using for loops, numpy is written explicitly to try to help you avoid python for loops. (Python for loops are terribly slow - which won't matter for most basic things, but will matter for handling lots of math on huge arrays.) In numpy, this is quite nice in that it often saves you lots of time without you having to do extra nonsense. You can convert a 1d array to a 2d nxm array or any such thing without actually copying any data, because all of that is just index math. This often makes it easier to use numpy functions to get the results you want without resulting to python for loops (which, if you're using numpy to eek out performance, should be avoided like the plague when possible). But the downside is a certain lack of clarity. Certain combinations of index tricks will require recopying the underlying data buffer, and it's not immediately obvious which ones. If you read their documentation, you can get an idea, but if you're me, you forget these rules as soon as you haven't looked at them for 3 days, and so it still takes non trivial mental work to figure out when numpy copies and when it doesn't. Of course, sometimes you don't care, and it's sufficient to let numpy avoid copying when it can and let it copy when it must, but sometimes that's not good enough. So there's a fair bit of complexity added by using the "indexes aren't necessarily the actual offsets in ram" approach. It's worth it sometimes (often), but for python lists, where you're probably gonna be using python for loops anyway, it may not be worth it always, so isn't baked into the implementation (and you can always implement a wrapper around a list to play index games yourself). But if you're doing something where this kind of optimization would be very useful for you, then numpy does it and does it well.
Find elsewhere
🌐
Cherry Servers
cherryservers.com › home › blog › python › how to reverse a list in python (using 3 simple ways)
How to Reverse a List in Python (Using 3 Simple Ways) | Cherry Servers
November 7, 2025 - This means they all require a linear amount of time relative to the list size. This refers to the additional memory used by the algorithm. reverse() Method: The space complexity is O(1), which is optimal for memory usage.
🌐
Upgrad
upgrad.com › home › tutorials › software & tech › how to reverse a list in python?
Reversing a List in Python
November 11, 2024 - Slicing with a step of -1 creates a new list with the elements in reverse order. It's a concise and efficient way to reverse a list. The two-pointer approach has a time complexity of O(n/2), where n is the length of the list.
🌐
Medium
medium.com › @ashokitschool › how-to-reverse-a-list-in-python-python-list-reverse-method-explained-3ab117a7d235
How to Reverse a List in Python? Python List reverse() Method Explained | by Ashok IT | Jan, 2026 | Medium
January 21, 2026 - Time Complexity: O(n) Space Complexity: reverse() → O(1) Slicing / Loop → O(n) Expecting reverse() to return a value · Confusing reverse() with sorted() Forgetting that slicing creates a new list · Featurereverse()reversed()Modifies original ...
🌐
Python
wiki.python.org › moin › TimeComplexity
TimeComplexity
[2] = Popping the intermediate ... 1 moves. The average case for an average value of k is popping the element the middle of the list, which takes O(n/2) = O(n) operations....
🌐
Unstop
unstop.com › home › blog › reversing python list | 10 ways explained with code examples
Python Reverse List | 10 Ways & Complexity Analysis ...
February 3, 2025 - To help you choose the best approach, let's compare the methods we discussed and analyze their complexities. Let’s discuss what this table indicates in reference to the worst and best methods for Python list reversal. ... reverse() Method: This is the most efficient in terms of time and space if you need to modify the list in place.
🌐
Wyzant
wyzant.com › resources › ask an expert
Array reversal in O( log n) time. | Wyzant Ask An Expert
January 19, 2024 - Reversing an array in O(log n) time complexity is not possible. The reason for this is that reversing an array involves swapping elements, and to perform a swap operation for each element in an array, you would need to traverse the entire array at least once.
🌐
Medium
medium.com › @khasnobis.sanjit890 › reversing-an-array-in-python-without-using-additional-memory-and-in-o-n-linear-time-complexity-b421a0be09e
Reversing an Array in python without using additional memory and in O(N) Linear time Complexity : Data Structure Array : Chapter 1 : In Python | by Sanjit Khasnobis | Medium
April 24, 2022 - N.B. Time complexity is how many times we have traversed through for loop to reverse the number which is near to n/2(n being the no of elements of array) so linear time complexity .. Space complexity is measured as you may have noticed in this example we did not use any temporary data structure to reverse the existing array list, we just used the same one so the program did not use any extra memory for that.
🌐
PrepBytes
prepbytes.com › home › python › how to reverse a list in python
How to Reverse a List in Python
April 28, 2023 - ['p', 'r', 'e', 'p', 'b', 'y', 't', 'e', 's'] Using reverse() ['s', 'e', 't', 'y', 'b', 'p', 'e', 'r', 'p'] Time Complexity: O(N) will be the time complexity to reverse a list in Python using the reverse method.
🌐
Python.org
discuss.python.org › python help
Beginner question: assigning variable to list.reverse() - Python Help - Discussions on Python.org
May 12, 2022 - Any idea why assigning variable Y to this does not result in anything? create a list of prime numbers x = [2, 3, 5, 7] reverse the order of list elements y=x.reverse() print(y)
🌐
Real Python
realpython.com › python-reverse-list
Reverse Python Lists: Beyond .reverse() and reversed() – Real Python
June 28, 2023 - Here, you ask Python to give you the complete list ([::-1]) but going over all the items from back to front by setting step to -1. This is pretty neat, but reversed() is more efficient in terms of execution time and memory usage. It’s also more readable and explicit.
🌐
WsCube Tech
wscubetech.com › resources › python › programs › list-reverse
Reverse a List in Python (6 Programs)
October 30, 2025 - Learn 6 different Python programs to reverse a list with easy examples, outputs, and explanations. Read now!