We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 705130f + c1e28b4 commit c9cb96cCopy full SHA for c9cb96c
1 file changed
data-structures/doubly-linked-list/doubly_linked_list.py
@@ -71,12 +71,8 @@ def top_back(self):
71
if self.is_empty():
72
print 'List is empty'
73
return
74
-
75
- curr = self.head
76
- while curr.next != None:
77
- curr = curr.next
78
79
- return curr.data
+
+ return self.tail.data
80
81
# removes the item at front of the linked list and return
82
def pop_front(self):
0 commit comments