In Chapter on stack and queues, the bootcamp talks about reversing a linked list. It says “iterate through the list printing entries , then perform another reverse to recover the list”. And then says it has O(1) space compelity.
what’s it talking about why are we printing entries?
I also don’t get perform another “reverse” phrase.
Reverse a list O(1) solution
abhigenie92
#1
0 Likes
abhigenie92
#2
Ok I got it.
I missed the part where the question said print out entries in reverse and not reverse the original linked list.
0 Likes