diff options
Diffstat (limited to 'pkg/priority_queue')
-rw-r--r-- | pkg/priority_queue/binary_heap.go | 12 | ||||
-rw-r--r-- | pkg/priority_queue/interface.go | 7 | ||||
-rw-r--r-- | pkg/priority_queue/queue.go | 20 |
3 files changed, 39 insertions, 0 deletions
diff --git a/pkg/priority_queue/binary_heap.go b/pkg/priority_queue/binary_heap.go new file mode 100644 index 00000000..c660ddb6 --- /dev/null +++ b/pkg/priority_queue/binary_heap.go @@ -0,0 +1,12 @@ +/* +binary heap (min-heap) algorithm used as a core for the priority queue +*/ + +package priorityqueue + +type BinHeap struct { +} + +func NewBinHeap() *BinHeap { + return &BinHeap{} +} diff --git a/pkg/priority_queue/interface.go b/pkg/priority_queue/interface.go new file mode 100644 index 00000000..d1c3229f --- /dev/null +++ b/pkg/priority_queue/interface.go @@ -0,0 +1,7 @@ +package priorityqueue + +type Queue interface { + Push() + Pop() + BLPop() +} diff --git a/pkg/priority_queue/queue.go b/pkg/priority_queue/queue.go index f09b99ff..88d18acb 100644 --- a/pkg/priority_queue/queue.go +++ b/pkg/priority_queue/queue.go @@ -1 +1,21 @@ package priorityqueue + +type QueueImpl struct { +} + +func NewPriorityQueue() *QueueImpl { + return nil +} + +// Push the task +func (q *QueueImpl) Push() { + +} + +func (q *QueueImpl) Pop() { + +} + +func (q *QueueImpl) BLPop() { + +} |