Skip to content

Commit

Permalink
Merge pull request wangzheng0822#257 from alouhaha/patch-2
Browse files Browse the repository at this point in the history
remove wrong code, add dequene() return
  • Loading branch information
wangzheng0822 authored Mar 5, 2019
2 parents 67b6efd + f36eb15 commit 32d20c4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions python/09_queue/array_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ def enqueue(self, item: str) -> bool:
return False
else:
for i in range(0, self._tail - self._head):
<<<<<<< HEAD
self._data[i] = self._items[i + self._head]
=======
self._items[i] = self._items[i + self._head]
>>>>>>> upstream/master
self._tail = self._tail - self._head
self._head = 0

Expand All @@ -38,6 +34,8 @@ def dequeue(self) -> Optional[str]:
item = self._items[self._head]
self._head += 1
return item
else:
return None

def __repr__(self) -> str:
return " ".join(item for item in self._items[self._head : self._tail])
Expand Down

0 comments on commit 32d20c4

Please sign in to comment.