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

A little help java

Options
  • 21-01-2002 11:34am
    #1
    Registered Users Posts: 1,684 ✭✭✭


    yeah seamus tis grand now figured it out eventually. cheers mate..


Comments

  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    I'm not entirely sure what you mean, but to make it user-interfaceable(:confused: ) take out the main method, and just have a class MaxHeap, with all those other methods in it, then create a class TestHeap or sumfink, and write a main method with prompts etc in it, that invokes the methods in MaxHeap. (that is what you meant by kbd isn't it?). OK, that's not necessary, but it's good practice, afaik. Umm if you want to be able to define the values in the array heap, just put some sort of prompt like:

    Enter the values you want for an array. '.' to finish:

    And then make a while loop that adds each value into the array (testing it first of course! :)), and checks to see if a '.' was entered to signify end of input. This is what I'm assuming you meant btw. :)


Advertisement