Skip to content

Commit a316b32

Browse files
Update
1 parent f63b196 commit a316b32

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

Chapter05/List_based_queue.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,22 @@ def dequeue(self):
2323

2424

2525

26-
q= ListQueue()
27-
q.enqueue(4)
28-
q.enqueue('dog')
29-
q.enqueue('cat')
30-
q.enqueue('monday')
26+
q = ListQueue()
27+
q.enqueue(20)
28+
q.enqueue(30)
29+
q.enqueue(40)
30+
q.enqueue(50)
31+
print(q.items)
32+
#Queue is full
33+
#[20, 30, 40]
3134

3235

33-
a= q.size1()
36+
data = q.dequeue()
37+
print(data)
38+
print(q.items)
39+
#20
40+
#[30, 40]
41+
42+
43+
a = q.size1()
3444
print(a)

0 commit comments

Comments
 (0)