Results 1 to 4 of 4

Math Help - Heapsort/trees!

  1. #1
    Newbie
    Joined
    Dec 2007
    From
    UK
    Posts
    23

    Heapsort/trees!

    Hi,

    I am trying to present the (attached) list of numbers in increasing order through the heapsort algorithm.

    Use the heapsort algorithm to put the following list of numbers in increasing order:

    3, 4, 1, 8, 2, 5, 7
    Last edited by CaptainBlack; February 15th 2008 at 08:38 AM.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    It would increase the chance of someone replying if you retyped the question rather than putting it in an attachment. Also if you have a graphic put it in a graphic file so at least we don't have to waste our time down loading a large word document which contains just an image.

    RonL
    Follow Math Help Forum on Facebook and Google+

  3. #3
    ads
    ads is offline
    Newbie
    Joined
    Feb 2008
    Posts
    5

    the correct order

    The heapsort algortim sorts the numbers from smallest to largest, so when input your numbers into the algorthm you get the output of
    1,2,3,4,5,6,7,8

    it has to make 60 compairsons and exchange 15 pairs
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Junior Member
    Joined
    Feb 2008
    Posts
    51
    Why don't you find the heapsort algorithm, and plug those numbers in, see what you get? It's pretty straight forward..
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Trees?
    Posted in the Discrete Math Forum
    Replies: 0
    Last Post: May 13th 2010, 04:27 PM
  2. Trees
    Posted in the Discrete Math Forum
    Replies: 0
    Last Post: November 21st 2009, 12:00 PM
  3. heapsort algorithm logic sets
    Posted in the Discrete Math Forum
    Replies: 0
    Last Post: February 19th 2009, 02:20 AM
  4. how can you plant 10 trees in 5 rows of 4 trees each?
    Posted in the Discrete Math Forum
    Replies: 4
    Last Post: December 22nd 2008, 11:43 AM
  5. Heapsort
    Posted in the Advanced Statistics Forum
    Replies: 1
    Last Post: December 2nd 2007, 07:08 AM

Search Tags


/mathhelpforum @mathhelpforum