CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Need help on Priority Queue Implementations

  1. #1
    Join Date
    Jun 2016
    Posts
    1

    Need help on Priority Queue Implementations

    Hi Everyone,

    I need implementations of Priority Queue by using ordered array,unordered array,ordered linked list and unordered linked list and also for the heap.I tried on internet for examples but they are very simple not interactive.I need operations like Insert,findMax,delMax and merge in interactive mode.Please help me for these implementations in C++.

    Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,768

    Re: Need help on Priority Queue Implementations

    What do you mean by "interactive mode"?

    Anyway, take a look at the std::priority_queue adapter for an example of what a priority queue interface might be like. To implement with an ordered array or unordered array, you can build your implementation with the help of say, std::vector. To implement with an ordered linked list or unordered linked list, you can build your implementation with the help of say, std::list. To implement with a heap, you could build your implementation with the help of say, a std::vector with std::make_heap, std::push_heap, and std::pop_heap.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  3. #3
    2kaud's Avatar
    2kaud is online now Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,254

    Re: Need help on Priority Queue Implementations

    I need implementations of Priority Queue
    Is this for a home-work assignment? if so, then given the advice from laserlight in post #2, if you post what you then have we'll be able to provide further advice and guidance. See http://forums.codeguru.com/showthrea...ork-assignment
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.7.3)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)