So I have this question in my algo class. Any help will be appreciated. The question is as follows. : Whenever you compare 3 no. it end up in 6 results and similarly 4 no it goes for 24 no. making permutation of no. of inputs.

The task is to compare n no. of sequence showing their comparison which leads to the
particular sequence

For example your input is a,b,c

If a<b
  If b<c
    Abc
    Else
      If a<c
          Acb
      Else a>c
          cab
 Else b>c
    Cba
    Else
       If a<c
          Bac
       Else
          Bca
   Else
      Cba

The task is to print all the comparisons which took place to lead that sequence for n no.s and
confirm that there is no duplication.