Skip to content

Commit c9cb96c

Browse files
authored
Merge pull request #3 from harris854/master
Updated doubly_linked_list.py
2 parents 705130f + c1e28b4 commit c9cb96c

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

data-structures/doubly-linked-list/doubly_linked_list.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,8 @@ def top_back(self):
7171
if self.is_empty():
7272
print 'List is empty'
7373
return
74-
75-
curr = self.head
76-
while curr.next != None:
77-
curr = curr.next
78-
79-
return curr.data
74+
75+
return self.tail.data
8076

8177
# removes the item at front of the linked list and return
8278
def pop_front(self):

0 commit comments

Comments
 (0)