Data Structures in Python: Doubly Linked Lists -- Reverse

preview_player
Показать описание
In this video, we consider how to reverse the nodes in a doubly linked list. Once we cover the concept of how to perform this action, we follow through with a Python implementation.

The software written in this video is available at:

Do you like the development environment I'm using in this video? It's a customized version of vim that's enhanced for Python development. If you want to see how I set up my vim, I have a series on this here:

If you've found this video helpful and want to stay up-to-date with the latest videos posted on this channel, please subscribe:
Рекомендации по теме
Комментарии
Автор

probably the only coder teaching DS in python as Effective way

prathameshTBSM
Автор

This one is a little bit confusing. I don't know why it works. You said you may have misspoken when you said temp = curr.prev stored 2 instead of None at 4:08. It still doesn't make sense if I follow through with temp = None.

saudahabib
Автор

Amazing, your videos help me a lot in my computer engineering journey.

realff
Автор

6:26
i didn't understand self.head = tmp.prev
after loop end tmp will be the last node, then why you wrote tmp.prev??

naveenkr.
Автор

sir, u are amazing. keep making more videos. It helps me a lot. thanks, u so much.

chetanyadav
Автор

when cur initially starts off at cur = self.head, isn't cur.prev supposed to point to None as opposed to B like you mentioned in the video?

neerajankam
Автор

one more approach can be taking a Doubly link list object and for every data in self, prepend this to new list and return new.printlist().Am i Right?
def reverse(self):
new=Doubly()
cur=self.head
while cur:
new.prepend(cur.data)
cur=cur.next
new.printlist()

prakhargurha
Автор

getting this error:
print(cur.data)
AttributeError: type object 'Node' has no attribute 'data'

rishikeshpuri
welcome to shbcf.ru