-
May 7th, 2011, 09:17 AM
#1
queue data structure question
i am working on a small confidential project for my office. you can provide theoretical answers if necessary.
how do i implement queue data structure in:
1. ArrayQueue.h/ArrayQueue.cpp : using an array
2. LListQueue.h/LListQueue.cpp : using a linked list
any help is appreciated, thanks in advance.
-
May 7th, 2011, 10:16 AM
#2
Re: queue data structure question
1. ArrayQueue - There is no direct C++ version but you can get close by using std::queue<T> which is based around a deque.
2. ListQueue - Use std::queue< T, std::list<T> > - queue using a doubly linked list instead of a deque.
Get Microsoft Visual C++ Express here or CodeBlocks here.
Get STLFilt here to radically improve error messages when using the STL.
Get these two can't live without C++ libraries, BOOST here and Loki here.
Check your code with the Comeau Compiler and FlexeLint for standards compliance and some subtle errors.
Always use [code] code tags [/code] to make code legible and preserve indentation.
Do not ask for help writing destructive software such as viruses, gamehacks, keyloggers and the suchlike.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|