Write an algorithm to calculate the average of a list of numbers. The algorithm should be understandable by a person who does not know a computer programming language (not written in code). Do not use pre-defined functions. The algorithm should be able to be converted into a computer program on a line by line basis (or at least close to it). Example of an algorithm for a binary search: Find the midpoint of the sorted array / list by dividing its length by 2. Compare the midpoint to the value of interest. If the midpoint is larger than the value, perform binary search on right half of the array. If the midpoint is smaller than the value, perform binary search on left half of the array. Repeat these steps until the midpoint value is equal to the value of interest or we know the value is not in the array
Write an
Trending now
This is a popular solution!
Step by step
Solved in 2 steps