Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

computer scientists an engineering C++ question

  • 01-09-2009 1:14pm
    #1
    Registered Users, Registered Users 2 Posts: 50 ✭✭


    hey i have this question hopefully its real easy for people doing pure computer science:

    "Write down the pseudo code for the princeple methods you would use to implement a priority queue as an ordered sequence using a linked list."

    im using thompsons c++ programming and havnt seen too much pseudo code or even priority queues!

    im just wondering if anyone could give me a sample solution?

    Thanks very much!


Comments

  • Closed Accounts Posts: 17,163 ✭✭✭✭Boston




  • Registered Users, Registered Users 2 Posts: 200 ✭✭Mountain_Surfer


    Robbie12 wrote: »
    hey i have this question hopefully its real easy for people doing pure computer science:

    "Write down the pseudo code for the princeple methods you would use to implement a priority queue as an ordered sequence using a linked list."

    im using thompsons c++ programming and havnt seen too much pseudo code or even priority queues!

    im just wondering if anyone could give me a sample solution?

    Thanks very much!

    Ah I see you are also doing 2e3 again too! I have no solution to that particular problem. Im just banking on the paper not being too different from the summer and the sample! Good luck


  • Moderators, Education Moderators, Home & Garden Moderators Posts: 8,287 Mod ✭✭✭✭Jonathan


    Ah I see you are also doing 2e1 again too! I have no solution to that particular problem. Im just banking on the paper not being too different from the summer and the sample! Good luck
    2e3 no?


  • Closed Accounts Posts: 7,794 ✭✭✭JC 2K3


    pseudocode is just code which doesn't have to be 100% correct, i.e. for demonstrating algorithmic principles as opposed to code which will compile. Basically, just write C++ code, but don't worry about the syntax being spot on. It's usually acceptable to throw in English sentences/made up functions that are obvious as to what they do too instead of the code to do so if it's time consuming and irrelevant to the algorithm.

    Googling priority queues should get you started...


  • Closed Accounts Posts: 17,163 ✭✭✭✭Boston


    Take a queue and for the insert/push/enqueue function add an int parameter priority. The priority parameter determines where in the linked list the element goes.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 50 ✭✭Robbie12


    yea im hoping the same but thats why if you have a solution to that question would be really handy because he seems to ask it alot if any1 can do this it would be really appreaciated,

    that link http://www.cs.princeton.edu/~wayne/cs423/fibonacci/FibonacciHeapAlgorithm.html

    notsure if its what im looking for?

    and ah yea was reading about pseudocode there i thought it had to be structured a certain way thats fine then but i havent done priority quesues as that teacher got replaced and he was just getting on to that so i dont even no how to answer the question ive been googling for ages !


  • Closed Accounts Posts: 7,794 ✭✭✭JC 2K3


    http://en.wikipedia.org/wiki/Priority_queue

    Seems fairly straightforward. What problem do you have?


  • Registered Users, Registered Users 2 Posts: 484 ✭✭brownacid


    Robbie12 wrote: »
    hey i have this question hopefully its real easy for people doing pure computer science:

    "Write down the pseudo code for the princeple methods you would use to implement a priority queue as an ordered sequence using a linked list."

    im using thompsons c++ programming and havnt seen too much pseudo code or even priority queues!

    im just wondering if anyone could give me a sample solution?

    Thanks very much!




    Throw us your email there and Ill send it on to you. Some guy in the programming centre gave me all the possible solutions that waldron can ask in that one.


  • Registered Users, Registered Users 2 Posts: 50 ✭✭Robbie12


    ah cool i sent there by pm thanks man.


Advertisement