Finding the first n largest elements in an array

后端 未结 8 457
不思量自难忘°
不思量自难忘° 2020-12-09 04:42

I have got an array containing unique elements. I need to find out the first n largest elements in the array in the least complexity possible. The solution that I could thin

8条回答
  •  清歌不尽
    2020-12-09 05:33

    //finding the bigest number in the array//
    
    double big = x[0];
    for(t=0;tbig)
        {
            big=x[t];
        }
    }
    printf("\nThe bigest number is    %0.2lf  \n",big);
    

提交回复
热议问题