← Back

Find Minimum and Maximum in an Array

Given an array of integers, find the minimum and maximum elements.

Algorithm

  1. Initialize min and max variables.
  2. Iterate through the array:
  3. Return or print the min and max values.

Time Complexity

The time complexity of this algorithm is O(n), where n is the number of elements in the array.

Array: []