sorting algorithm

Posted by mysterious jean on Stack Overflow See other posts from Stack Overflow or by mysterious jean
Published on 2010-03-24T07:59:35Z Indexed on 2010/03/24 8:03 UTC
Read the original article Hit count: 414

Filed under:
|
|

I want to make simple sorting algorithm...like below...

if there is character "abcde".... the character is stored like below.. could you tell me the algorithm for that?

arr[0] = "a"
arr[1] = "ab"
arr[2] = "ac"
arr[3] = "ad"
arr[4] = "ae"
arr[5] = "abc"
arr[6] = "abd"
arr[7] = "abe"
...
arr[n] = "abcde"

arr[n+1] = "b"
arr[n+2] = "bc"
arr[n+3] = "bd"
arr[n+4] = "be"
arr[n+5] = "bcd"
arr[n+5] = "bce"
arr[n+5] = "bde"
...
arr[n+m] = "bcde"
...
...

© Stack Overflow or respective owner

Related posts about c

    Related posts about c++