CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2011
    Posts
    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.

  2. #2
    Join Date
    Nov 2008
    Location
    England
    Posts
    748

    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
  •  





Click Here to Expand Forum to Full Width

Featured