Domanda di colloquio di Intel Corporation

Find the maximum integer in an unsorted array of integers.

Risposta di colloquio

Anonimo

3 giu 2020

Solution 1: sort the array and retrieve the last element in the array. Solution 2: Assign the first element to be the maximum, linear scan the array and assign a new maximum as long as it greater than the current maximum.