Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. sorting data by size.

sorting data by size.

Scheduled Pinned Locked Moved C / C++ / MFC
algorithmsdata-structuresquestion
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SilverShalkin
    wrote on last edited by
    #1

    ok... i have an array that its size always changes... like array[inc]; array is the array ofcource and inc //incriment. the program allows you to add a number to a list of numbers... then you press 'p', and you would print the number list. what i want to do is make it for if you press 's' then the program would sort all the data in array[] to least to greatest. i have s in a switch of menu "which is a char" so... case 's' : { ... //least to greates program } how would i accomplish this? thanks! ~SilverShalkin :rose:

    N 1 Reply Last reply
    0
    • S SilverShalkin

      ok... i have an array that its size always changes... like array[inc]; array is the array ofcource and inc //incriment. the program allows you to add a number to a list of numbers... then you press 'p', and you would print the number list. what i want to do is make it for if you press 's' then the program would sort all the data in array[] to least to greatest. i have s in a switch of menu "which is a char" so... case 's' : { ... //least to greates program } how would i accomplish this? thanks! ~SilverShalkin :rose:

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      Bubblesort was one of the easiest sorting algorithms I used to implement for most of my school assignments. I wasn't very efficient, but it was easy to implement. Nish


      The posting stats are now in PDF:- http://www.busterboy.org/codeproject/ Feel free to make your comments. Updated - May 04th, Saturday

      L L 2 Replies Last reply
      0
      • N Nish Nishant

        Bubblesort was one of the easiest sorting algorithms I used to implement for most of my school assignments. I wasn't very efficient, but it was easy to implement. Nish


        The posting stats are now in PDF:- http://www.busterboy.org/codeproject/ Feel free to make your comments. Updated - May 04th, Saturday

        L Offline
        L Offline
        l a u r e n
        wrote on last edited by
        #3

        and if you dont want to write your own try using the quicksort that is built into the c runtimes :)


        situations to avoid #37:
        "good morning ... how many sugars do you take in your coffee ... and what was your name again?"

        coming soon: situations to avoid #38: "...and the dog was there too?"

        S 1 Reply Last reply
        0
        • L l a u r e n

          and if you dont want to write your own try using the quicksort that is built into the c runtimes :)


          situations to avoid #37:
          "good morning ... how many sugars do you take in your coffee ... and what was your name again?"

          coming soon: situations to avoid #38: "...and the dog was there too?"

          S Offline
          S Offline
          SilverShalkin
          wrote on last edited by
          #4

          so... bubblesort and quicksort? if it is possible.. can you show me an example? if not ill try and figuer how it works in msdn. thanks ~SilverShalkin :rose:

          1 Reply Last reply
          0
          • N Nish Nishant

            Bubblesort was one of the easiest sorting algorithms I used to implement for most of my school assignments. I wasn't very efficient, but it was easy to implement. Nish


            The posting stats are now in PDF:- http://www.busterboy.org/codeproject/ Feel free to make your comments. Updated - May 04th, Saturday

            L Offline
            L Offline
            Learning 0
            wrote on last edited by
            #5

            This link does not take you to Sort

            N 1 Reply Last reply
            0
            • L Learning 0

              This link does not take you to Sort

              N Offline
              N Offline
              Nish Nishant
              wrote on last edited by
              #6

              Learning wrote: This link does not take you to Sort Which link? :confused: Nish :confused:


              The posting stats are now in PDF:- http://www.busterboy.org/codeproject/ Feel free to make your comments. Updated - May 04th, Saturday

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups