Category "priority-queue"

C++ how to declare an array of priority_queue with customed comparator

With the idea from: declaring a priority_queue in c++ with a custom comparator , I tried to use lambda as comparator for the priority_queue, but when I tried to

Peeking into the top of the Priority Queue in Go?

I was trying to implement a sample program using heap, and I am able to Push and Pop from the Heap. I was able to implement the Push and Pop methods and use th

Java PriorityQueue no way to initialize with a Collection and custom comparator?

I read through the implementation of Java PriorityQueue, the constructors it has are: PriorityQueue() PriorityQueue(Collection<? extends E> c) Priority

Xinu - Setting new priority for a Suspended state process

I have created a process X in Xinu along with other two processes (y, z). The y and z are high priority than X, so they both are running as per scheduling polic

Implementing Priority queue using hashmap

This may be a very naive question or does not make sense. But i am really confused about implementation of priority queue. Why we cannot use a hashmap with key

Process starvation test case on XINU

I am trying to produce a test case for demonstrating starvation by xinu's default scheduling policy.: if 2 processes are ready for execution, the one with highe

How to get Priority of C# PriorityQueue element

I am initializing a priority queue that stores XY coordinates, prioritized by their euclidian distance from origin. I created a custom Comparer that makes this

TypeError: '<' not supported between instances of 'State' and 'State' PYTHON 3

I am trying to utilize a PriorityQueue from the queue class. However, i'm having issues putting custom objects into my PQ. I have implemented the __cmp__ functi

Confused over compareTo implementation with PriorityQueue

I am trying to write a program where I replicate a registrar's office using a priority queue. The sorting for this priority queue would be based on a higher GPA