Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Implement solution kinda
  • Loading branch information
myfineprint committed Oct 18, 2019
commit 651caadeba5e7e21cf211c8e5072121b6967c75a
22 changes: 20 additions & 2 deletions reverse/reverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,24 @@ def contains(self, value):
# if we've gotten here, then the target node isn't in our list
return False


def reverse_list(self):
# TO BE COMPLETED
pass
if not self:
return


current = self.head
next = self.head.get_next()

if not next:
return current

if next:
next.set_next(current)
current = next
self.reverse_list()

return