The standard algorithms are a set of well-known steps for getting results from a list of values. count the occurrences of a value (how many times does a value appear in a list). find maximin, find minimum (what is the largest, or smallest, value in a list. search for, to locate or check for, the presence of a target value in a list. how many values are above 50 (count) what is the largest value (find max) what is the lowest value (find min) does the value 50 appear (linear search) 3 if next value matches target condition count values above 50 result: 2 3 if next value is larger than max 3 if next value is smaller than min 3 if value matches search target search for 50 result: true re-using a standard algorithm design count, multiple counts/ conditions search and stop, report position how many values are above 50, how many are below 45 (count) what is the largest value and what position is it in the list (find max) what is the lowest value and what position is it in the list (find min) does the value 50 appear and at what position (linear search) 4 if next value matches first target condition 7 if next value matches second target condition 11 display countA, countB count values above 50 and those below 45 result: 2 report the location of the max value 3 loop for each value starting at the second value 4 if next value is larger than max 6 set maxPosition to position of next value result : 61 at position 4 report the location of the min value 3 loop for each value starting at the second value 4 if next value is smaller than min 6 set minPosition to position of next value result : 39 at position 5 stop searching as soon a value is located, 3 loop while found = 0 and position < length of data array 4 if value at position matches search target 5 set found to position of next value 12 display value located at found search for 50 result: true integration of algorithms find max and min on a single traverse
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (