Pergunta de entrevista da empresa QA InfoTech

program to find second largest element in an array

Respostas da entrevista

Sigiloso

10 de fev. de 2017

public static int findSecondLargestV3(int[] array){ if(array.length == 0 || array.length max){ secondMax = max; max = array[i]; } } return secondMax; } Complexity of this algorithm is O(n)

Sigiloso

10 de fev. de 2017

public static int findSecondLargestV3(int[] array){ if(array.length == 0 || array.length max){ secondMax = max; max = array[i]; } } return secondMax; }