forked from DaniloDamico/EX2IA19
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpriorityQueue.py
More file actions
25 lines (23 loc) · 854 Bytes
/
priorityQueue.py
File metadata and controls
25 lines (23 loc) · 854 Bytes
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
from Librerie.priorityQueues.PQbinomialHeap import PQbinomialHeap
from Librerie.priorityQueues.PQ_Dheap import PQ_DHeap
from Librerie.priorityQueues.PQbinaryHeap import PQbinaryHeap
from enum import Enum
class TypeQueue(Enum):
BINARH = 1 #Binary Heap
BINOMH = 2 #Binomial Heap
DHEAP3 = 3 #D-Heap, d=10
DHEAP10 = 4 #D-Heap, d=10
DHEAP100 = 5 #D-Heap, d=10
class PriorityQueue:
def __init__(self, type):
self.queue = None
if type == TypeQueue.BINARH:
self.queue = PQbinaryHeap()
elif type == TypeQueue.BINOMH:
self.queue = PQbinomialHeap()
elif type == TypeQueue.DHEAP3:
self.queue = PQ_DHeap(3)
elif type == TypeQueue.DHEAP10:
self.queue = PQ_DHeap(10)
elif type == TypeQueue.DHEAP100:
self.queue = PQ_DHeap(100)