-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqueue_rear.py
More file actions
68 lines (57 loc) · 1.88 KB
/
queue_rear.py
File metadata and controls
68 lines (57 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import os
import queue_implementaion
import queue_creating
class style():
BLACK = '\033[30m'
RED = '\033[31m'
GREEN = '\033[32m'
YELLOW = '\033[33m'
BLUE = '\033[34m'
MAGENTA = '\033[35m'
CYAN = '\033[36m'
WHITE = '\033[37m'
UNDERLINE = '\033[4m'
RESET = '\033[0m'
def queue_rear_check():
queue = queue_creating.queue_return()
if queue == []:
print(style.RED + "Your queue is empty")
input("Enter any key to close: ")
queue_rear()
else:
print(style.RED + "Your queue rear element is " + str(queue[-1]) + " .")
input("Enter any key to close: ")
queue_rear()
def queue_rear_review():
print(style.WHITE + """
def queue_rear_check():
queue = queue_creating.queue_return()
if queue == []:
print(style.RED + "Your queue is empty")
input("Enter any key to close: ")
queue_rear()
else:
print(style.RED + "Your queue rear element is " + str(queue[-1]) +" .")
input("Enter any key to close: ")
queue_rear()
""")
input(style.RED + "Enter any key to close: ")
queue_rear()
def queue_rear():
print(style.YELLOW + """
[+] The "rear" element of the queue is the element that was last pushed and will be the first to be popped.
The "bottom" element of the queue is the one that, when removed, will leave the queue empty.
1: Check the rear element in your created queue
2: code review
3: back
""")
selection = input("Enter your selection: ")
if selection == '1':
queue_rear_check()
elif selection == '2':
queue_rear_review()
elif selection == '3':
queue_implementaion.queue_implementaion()
else:
print(style.RED + "[+] invalid input try again!")
queue_rear()