Click here to Skip to main content
15,887,485 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: Special minimum spanning tree Pin
Andy Oct202116-Mar-22 15:58
Andy Oct202116-Mar-22 15:58 
AnswerRe: Special minimum spanning tree Pin
akratirawat30-Jun-22 19:38
akratirawat30-Jun-22 19:38 
QuestionTriangulation inside a contour Pin
Member 1505866510-Mar-22 1:44
Member 1505866510-Mar-22 1:44 
AnswerRe: Triangulation inside a contour Pin
Gerry Schmitz10-Mar-22 16:27
mveGerry Schmitz10-Mar-22 16:27 
GeneralRe: Triangulation inside a contour Pin
Member 1505866510-Mar-22 20:43
Member 1505866510-Mar-22 20:43 
GeneralRe: Triangulation inside a contour Pin
Gerry Schmitz11-Mar-22 4:05
mveGerry Schmitz11-Mar-22 4:05 
GeneralRe: Triangulation inside a contour Pin
Member 1505866511-Mar-22 19:56
Member 1505866511-Mar-22 19:56 
QuestionWriting 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 Pin
Ahmed Ehab 20225-Mar-22 3:20
Ahmed Ehab 20225-Mar-22 3:20 
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 corner cases it might need to handle, such as N = 0 or N = 1?

How to submit:

Enter your algorithm in the text box. You can work
 in another program and copy/paste into the box, or you can type your 
algorithm directly. 

Your algorithm should be written in clear English, not C code.


1 point
What do you think?
Your answer cannot be more than 10000 characters.

AnswerRe: 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. Pin
Dave Kreskowiak10-Mar-22 2:59
mveDave Kreskowiak10-Mar-22 2:59 
Questionconcern to shaker sort arlgorithm Pin
Member 1523340925-Jan-22 3:38
Member 1523340925-Jan-22 3:38 
AnswerRe: concern to shaker sort arlgorithm Pin
Richard Andrew x6410-Feb-22 9:27
professionalRichard Andrew x6410-Feb-22 9:27 
QuestionVerification Algorithm that mortals can use to verify chain of discussion making. Pin
XxKeldecknightxX7-Jan-22 1:45
XxKeldecknightxX7-Jan-22 1:45 
AnswerRe: Verification Algorithm that mortals can use to verify chain of discussion making. Pin
Eddy Vluggen9-Feb-22 1:56
professionalEddy Vluggen9-Feb-22 1:56 
AnswerRe: Verification Algorithm that mortals can use to verify chain of discussion making. Pin
Eddy Vluggen9-Feb-22 12:06
professionalEddy Vluggen9-Feb-22 12:06 
QuestionWildcard Matching Routine Pin
Richard Andrew x6424-Dec-21 9:17
professionalRichard Andrew x6424-Dec-21 9:17 
AnswerRe: Wildcard Matching Routine Pin
Gerry Schmitz25-Dec-21 5:24
mveGerry Schmitz25-Dec-21 5:24 
GeneralRe: Wildcard Matching Routine Pin
Richard Andrew x6425-Dec-21 6:09
professionalRichard Andrew x6425-Dec-21 6:09 
GeneralRe: Wildcard Matching Routine Pin
Gerry Schmitz25-Dec-21 8:25
mveGerry Schmitz25-Dec-21 8:25 
AnswerRe: Wildcard Matching Routine Pin
k505425-Dec-21 7:16
mvek505425-Dec-21 7:16 
GeneralRe: Wildcard Matching Routine Pin
Richard Andrew x6426-Dec-21 1:32
professionalRichard Andrew x6426-Dec-21 1:32 
AnswerRe: Wildcard Matching Routine Pin
englebart8-Feb-22 16:36
professionalenglebart8-Feb-22 16:36 
GeneralRe: Wildcard Matching Routine Pin
trønderen9-Feb-22 6:35
trønderen9-Feb-22 6:35 
GeneralRe: Wildcard Matching Routine Pin
englebart9-Feb-22 15:37
professionalenglebart9-Feb-22 15:37 
GeneralRe: Wildcard Matching Routine Pin
Eddy Vluggen9-Feb-22 16:10
professionalEddy Vluggen9-Feb-22 16:10 
GeneralRe: Wildcard Matching Routine Pin
trønderen10-Feb-22 6:03
trønderen10-Feb-22 6:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.