Shift Forward

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nurulshidanoni
    New Member
    • Sep 2007
    • 40

    #1

    Shift Forward

    Given 80 35 5 12 60 25
    When 80, do not do nothing, but when 35 , i want to shift it forward like
    35 80 5 12 60 25
    The I want to do an iteration again,unitl get 5 12 35 60 80.
  • Meetee
    Recognized Expert Contributor
    • Dec 2006
    • 928

    #2
    Originally posted by nurulshidanoni
    Given 80 35 5 12 60 25
    When 80, do not do nothing, but when 35 , i want to shift it forward like
    35 80 5 12 60 25
    The I want to do an iteration again,unitl get 5 12 35 60 80.
    Hi,
    You can use any sorting method like bubble sort. It is in Article session. Also search on google for this.

    Regards

    Comment

    • sicarie
      Recognized Expert Specialist
      • Nov 2006
      • 4677

      #3
      Originally posted by nurulshidanoni
      Given 80 35 5 12 60 25
      When 80, do not do nothing, but when 35 , i want to shift it forward like
      35 80 5 12 60 25
      The I want to do an iteration again,unitl get 5 12 35 60 80.
      I'm sorry, but your algorithm does not make sense to me. When 80 do nothing? So you will never sort it, as it starts with 80. Please be more clear as to what you are trying to do.

      Comment

      • nurulshidanoni
        New Member
        • Sep 2007
        • 40

        #4
        Dear Sicarie

        It was not a sort, but shift forward. That why, whne meet 80 do not do nothing , but when see 35 it smaller than 80, i want to shift forward.80 35......



        Originally posted by sicarie
        I'm sorry, but your algorithm does not make sense to me. When 80 do nothing? So you will never sort it, as it starts with 80. Please be more clear as to what you are trying to do.

        Comment

        Working...