Calcul des asymptotiques - 1
                                  
                                    
       
    
                                   
                                  Задача
                                  Pour le code ci-dessous, recherchez les asymptotiques :
int func(vecteur <int> arr) {
    intn = arr.size();
    int max1 = INT_MIN, pos1 = -1 ;
    pour (int je = 0; je < n; je++) {
        si (arr[i] > max1) {
            max1 = tab[i] ;
            pos1 = je ;
        }
    }
    int max2 = INT_MIN, pos2 = -1 ;
    pour (int je = 0; je < n; je++) {
        si (i == pos1) continuer ;
        si (arr[i] > max2) {
            max2 = tab[i] ;
            pos2 = je ;
        }
        renvoie max2 ;
    }
1) O(1)
2) O(log(n))
3) O(n)
4) O(n^2)
 
                               
           
                               
                               
                                        Выберите правильный ответ, либо введите его в поле ввода
                              Комментарий учителя