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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
A

Ahmed Ehab 2022

@Ahmed Ehab 2022
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Writing a Sorting Algorithm Total points 4 1. Question 1 Assignment overview This assignment is an opportunity for you to develop an algorithm of your own and have someone else execute it to give you feedback on its correctness and specificity. Yo
    A Ahmed Ehab 2022

    Writing a Sorting Algorithm
    Total points 4
    1.
    Question 1
    Assignment overview
    This assignment is an opportunity for you to develop an
    algorithm of your own and have someone else execute it to give you
    feedback on its correctness and specificity.

    You will write an
    algorithm that sorts temperature data from least to greatest. To do
    this, you will work through the first four of the Seven Steps.

    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

    Source: https://www.ncdc.noaa.gov/sotc/global-regions/201701

    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

    Step 1: Work an example by hand

    Take the list
    of values, and sort them by hand. Sort them the way that comes most
    naturally to you. Do not research sorting algorithms or try to figure
    out the most efficient method—that is not the point of this assignment.

    Step 2: Write down exactly what you did

    Think
    carefully about how you performed the sort by hand. What values did you
    compare? In what order? How did you know when you were done? Write down
    these steps exactly.

    Step 3: Generalize

    Look for patterns in the steps you wrote down for Step 2. If you
    repeated sets of steps, how could you count repetitions? If you swapped
    certain values under certain conditions, what were they? Are there
    variables you need to name in order to reuse? Write down your
    step-by-step generalized algorithm.

    Step 4: Test your algorithm

    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

    Algorithms algorithms question beta-testing tutorial code-review
  • Login

  • Don't have an account? Register

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