By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,370 Members | 1,574 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,370 IT Pros & Developers. It's quick & easy.

Priority queue powered by a min heap

P: 1
i need to create a program that will implement a priorty queue for a global shipping company. the program needs to keep track of which package needs to leave the warehouse next. you can only interact with one package at a time.

the system has to perform 3 options:
look at which package is next
pick up a package to be shipped
add a package to the queue

and also this must include some troubleshooting features.
you need to be able to print a pre-order traversal of the heap
a post-order
and an in-order

the user must also be able to save the content of the queue to a file when it is closed. the program will load up a file at startup which may contain the priority queue as it existed before quitting

my partners and i have no idea where to begin with this we have thought about binary trees and dynamic queues but can't get anything started. a shove in the right direction maybe a little more help would be greatly appreciated.

thank you.
Nov 15 '07 #1
Share this Question
Share on Google+
1 Reply


weaknessforcats
Expert Mod 5K+
P: 9,197
Are you using C++??

If so, use the C++ Standard Library priority_queue container adapter.

This container can float on a vector (array implementation) or a deque (linked list implementation.

Otherwise, you will be writing infrastructure code that is probably not portable in the future and that will maximize your project development and maintence costs.
Nov 16 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.