Exercise 1: Algorithms

CSULB Intro to R

April 13, 2018

Exercise

Algorithm: Find the Height of the Tallest Person in the Room

Input: List of heights of people in the room, \(H = [height_1, height_2, \ldots]\)

Output: Height of the tallest person in the room, \(tallest\)

\(tallest = height_1\)

for each \(item\) in \(H\), do

     if \(item > tallest\), then

         \(tallest = item\)

return \(tallest\)