Priority Queues in C++, Java and Python