mirror of
https://hub.njuu.cf/TheAlgorithms/Python.git
synced 2023-10-11 13:06:12 +08:00
Method Names Changed for completeness
This commit is contained in:
parent
9b2d32e8a3
commit
82ffc6e50b
@ -7,7 +7,7 @@ class Queue():
|
|||||||
"""Enqueues {@code item}
|
"""Enqueues {@code item}
|
||||||
@param item
|
@param item
|
||||||
item to enqueue"""
|
item to enqueue"""
|
||||||
def enqueue(self, item):
|
def put(self, item):
|
||||||
self.entries.append(item)
|
self.entries.append(item)
|
||||||
self.length = self.length + 1
|
self.length = self.length + 1
|
||||||
print(self.entries)
|
print(self.entries)
|
||||||
@ -16,7 +16,7 @@ class Queue():
|
|||||||
@requirement: |self.length| > 0
|
@requirement: |self.length| > 0
|
||||||
@return dequeued
|
@return dequeued
|
||||||
item that was dequeued"""
|
item that was dequeued"""
|
||||||
def dequeue(self):
|
def get(self):
|
||||||
self.length = self.length - 1
|
self.length = self.length - 1
|
||||||
dequeued = self.entries[0]
|
dequeued = self.entries[0]
|
||||||
self.entries = self.entries[1:]
|
self.entries = self.entries[1:]
|
||||||
@ -28,7 +28,7 @@ class Queue():
|
|||||||
return self.entries[0]
|
return self.entries[0]
|
||||||
|
|
||||||
"""Returns the length of this.entries"""
|
"""Returns the length of this.entries"""
|
||||||
def length(self):
|
def size(self):
|
||||||
return self.length
|
return self.length
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user