Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

two separate questions Write an algorithm to find the largest number in a list. The algorithm should be understandable by a person who does not

two separate questions image text in transcribed
image text in transcribed
Write an algorithm to find the largest number in a list. 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 for 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 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions