-
Notifications
You must be signed in to change notification settings - Fork 0
/
pf.py
84 lines (60 loc) · 1.49 KB
/
pf.py
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
class Node:
def __init__(self, dados):
self.dados = dados
self.next = None
class FilaListaEncadeada:
def __init__(self):
self.front = self.rear = None
def isEmpty(self):
return self.front == None
def Enfileirar(self, item):
temp = Node(item)
if self.rear == None:
self.front = self.rear = temp
return
self.rear.next = temp
self.rear = temp
def Desenfileirar(self):
if self.isEmpty():
return
temp = self.front
self.front = temp.next
if (self.front == None):
self.rear = None
def imprimir(self):
iternode = self.front
if self.isEmpty():
print("Fila Está Vazia ")
else:
while (iternode != None):
print(iternode.dados, "->", end = " ")
iternode = iternode.next
return
Fila = FilaListaEncadeada()
a, b = input().split()
Fila.Enfileirar(a)
Fila.Enfileirar(b)
c = (input())
for i in a:
d = (input())
print("entrou aqui",d)
for i in c:
f = (input())
print("entrou aqui", f)
while i < c:
if i < a:
temp = b * a
else:
valor2 = temp
z = 0
for i in a:
if valor2 > temp:
valor2 = temp
z = i
temp += b * a
z = 0
for i in a:
if valor2 < temp:
valor2 = temp
print("valor e\n", valor2)
Fila.imprimir()