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. Writing a Sorting Algorithm -- NEED HELP!

Writing a Sorting Algorithm -- NEED HELP!

Scheduled Pinned Locked Moved C / C++ / MFC
algorithmshelpquestion
5 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.
  • U Offline
    U Offline
    User 13535147
    wrote on last edited by
    #1

    Introduction to the data: NOAA's National Centers for Environmental Information collects global climate data and aggregates this data to provide information on climate trends and variability. One product they offer is a monthly regional analysis. The following table gives "anomaly" data by continent for January 2017. "Anomaly" means the value is the temperature difference from the average temperature from years 1910–2000. Continent Anomaly (C) North America 3.18 South America 1.36 Europe -0.12 Africa 0.53 Asia 1.92 Oceania 0.98 Assignment task: Your task is to develop an algorithm that would sort data such as these from least to greatest. Specifically, given an unsorted set of N decimal values, your algorithm should sort them to give an answer of the sorted data. For this set of N = 6, your algorithm should produce: -0.12 0.53 0.98 1.36 1.92 3.18 Execute your algorithm for a different set of data, such as a subset of the given data, data you make up, or another month's climate data, such as February 2017: https://www.ncdc.noaa.gov/sotc/global-regions/201702 Does your algorithm work for any N? Have you thought of corner cases it might need to handle, such as N = 0 or N = 1?

    P D 2 Replies Last reply
    0
    • U User 13535147

      Introduction to the data: NOAA's National Centers for Environmental Information collects global climate data and aggregates this data to provide information on climate trends and variability. One product they offer is a monthly regional analysis. The following table gives "anomaly" data by continent for January 2017. "Anomaly" means the value is the temperature difference from the average temperature from years 1910–2000. Continent Anomaly (C) North America 3.18 South America 1.36 Europe -0.12 Africa 0.53 Asia 1.92 Oceania 0.98 Assignment task: Your task is to develop an algorithm that would sort data such as these from least to greatest. Specifically, given an unsorted set of N decimal values, your algorithm should sort them to give an answer of the sorted data. For this set of N = 6, your algorithm should produce: -0.12 0.53 0.98 1.36 1.92 3.18 Execute your algorithm for a different set of data, such as a subset of the given data, data you make up, or another month's climate data, such as February 2017: https://www.ncdc.noaa.gov/sotc/global-regions/201702 Does your algorithm work for any N? Have you thought of corner cases it might need to handle, such as N = 0 or N = 1?

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      Please don't cross post.

      U 1 Reply Last reply
      0
      • P PIEBALDconsult

        Please don't cross post.

        U Offline
        U Offline
        User 13535147
        wrote on last edited by
        #3

        Sorry about that! First time using this website.

        L 1 Reply Last reply
        0
        • U User 13535147

          Sorry about that! First time using this website.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Then please read the guidelines: HOW TO ASK A QUESTION - C / C++ / MFC Discussion Boards[^]

          1 Reply Last reply
          0
          • U User 13535147

            Introduction to the data: NOAA's National Centers for Environmental Information collects global climate data and aggregates this data to provide information on climate trends and variability. One product they offer is a monthly regional analysis. The following table gives "anomaly" data by continent for January 2017. "Anomaly" means the value is the temperature difference from the average temperature from years 1910–2000. Continent Anomaly (C) North America 3.18 South America 1.36 Europe -0.12 Africa 0.53 Asia 1.92 Oceania 0.98 Assignment task: Your task is to develop an algorithm that would sort data such as these from least to greatest. Specifically, given an unsorted set of N decimal values, your algorithm should sort them to give an answer of the sorted data. For this set of N = 6, your algorithm should produce: -0.12 0.53 0.98 1.36 1.92 3.18 Execute your algorithm for a different set of data, such as a subset of the given data, data you make up, or another month's climate data, such as February 2017: https://www.ncdc.noaa.gov/sotc/global-regions/201702 Does your algorithm work for any N? Have you thought of corner cases it might need to handle, such as N = 0 or N = 1?

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            I'm seeing the word you/your seven times in that post. Somehow I do not feel that translates to us. if you need help with something you did, feel free to post the code, tell what it does or doesn't do, what it should do, and what you've tried. Ask specific questions, rather than broad questions.

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

            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