Wrong output in dnf sort

i have tried to run the code for dnf sort but it is showing wrong output . pls tell what is wrong ?

Hey @Raghavsingla522
Add else in ifs i.e

  else if(arr[mid]==1)

and

 else  if(arr[mid]==2)

Sir forgot this