Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Implementing a queue or stack using a heap

  1. #1
    Junior Member
    Join Date
    Nov 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Implementing a queue or stack using a heap

    Title pretty much says it all. And before anybody asks YES this IS a HOMEWORK assignment.

    I'm not asking you to solve it only to help me clarify and maybe give me a place to start.

    I personally don't care what I end up using, stacks or queues, the differences are negligible to me and the only difference would be opposing comparisons I do believe. The only thing I'm really after is a starting point, my book offers nothing on this and I can't ask my teacher for the obvious reason of shes not the java teacher!

    Anyway, I've done trees and BST's as well as stacks and queues but combing the 2 is leaving me to scratch my head at the moment, I was thinking of doing something like a priority queue..just with a heap. What I'm saying is pass the priority queue node the element and priority, and build a heap out of the priority. Does that make any sense?

    Any help would be awesome, thanks


  2. #2
    Junior Member
    Join Date
    Nov 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Implementing a queue or stack using a heap

    ttt

    Anybody?

Similar Threads

  1. Stack
    By AmyH in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 7th, 2010, 04:04 PM
  2. Implementing a 5-heap with an array
    By TBBucs in forum Algorithms & Recursion
    Replies: 0
    Last Post: April 12th, 2010, 10:56 PM
  3. Stack Order?
    By TimW in forum AWT / Java Swing
    Replies: 2
    Last Post: September 19th, 2009, 07:33 AM
  4. Error of "cannot access InToPost" in 3 and 5 code
    By jaysoncutie in forum What's Wrong With My Code?
    Replies: 2
    Last Post: August 25th, 2009, 09:12 AM
  5. How do I fix my program so I can use the keyboard to type in the numbers?
    By rocafella5007 in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: April 29th, 2009, 02:39 PM