Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

petew71

  • 2 years ago

week 6. Ex 3.6-your first class. Queue class. I'm assuming that this class needs to be a list? I can not work out how to incorporate a list into a class and how to modify it!..Or am i barking up the wrong tree with this one? Any assistance would be welcome!

  • This Question is Open
  1. AppylPye
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    petew71: You could implement the Queue using a list, but there other other choices as well. Here is a an implementation of the Queue class using a list: http://ideone.com/zKA2YP For another implementation that does not use a list, and is a little more complex, take a look at this one: http://ideone.com/WCxNBy

  2. petew71
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Hi there AppylPye. Thanks for your response! I asked around and came up with a program very similar to your list example. Though my remove method is a little different. http://pastebin.com/2EnAHEYM Your other, more complex, program is far better than i can do at the moment! Very well done!

  3. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy