standard algorithmsstandard algorithms

Solve problems by applying these well known techniques

ℹ️ standard algorithms

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.

data array

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)

count algorithm

count values above 50 result: 2

result : 61

result : 39

linear search algorithm

search for 50 result: true
re-using a standard algorithm design

ℹ️ algorithms remix

count, multiple counts/ conditions
max and position
min and position
search and stop, report position
search without flag

data array

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)

count algorithm

count values above 50 and those below 45 result: 2

find max algorithm

remix:
report the location of the max value
result : 61 at position 4

find min algorithm

remix:
report the location of the min value
result : 39 at position 5

linear search algorithm

remix:
stop searching as soon a value is located,
report the location
use a while loop
search for 50 result: true

ℹ️ algorithm mashup

sequence of algorithms
max then count

integration of algorithms
find max and min on a single traverse