Skip to content

Commit 5f5dd2b

Browse files
authored
Update binary_numbers.py
#CR comment: I think rear term should be used in def front(self). [-1] is the rear of the queue. using front is slightly confusing. Though it won't affect the outcome
1 parent aa75de9 commit 5f5dd2b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

data_structures/6_Queue/Exercise/binary_numbers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ def size(self):
2222

2323
def front(self):
2424
return self.buffer[-1]
25+
#CR comment: I think rear term should be used here. [-1] is the rear of the queue. using front is slightly confusing. Though it won't affect the outcome
2526

2627
def produce_binary_numbers(n):
2728
numbers_queue = Queue()
2829
numbers_queue.enqueue("1")
30+
#CR comment: "1" is string type
2931

3032
for i in range(n):
3133
front = numbers_queue.front()
@@ -37,4 +39,4 @@ def produce_binary_numbers(n):
3739

3840

3941
if __name__ == '__main__':
40-
produce_binary_numbers(10)
42+
produce_binary_numbers(10)

0 commit comments

Comments
 (0)