I have an array of a structure which is supposed to store unique character strings. Which sorting algorithm is best suited for such requirements.
Here is the structure
strcut info
{
unsigned char key[33];
unsigned int size;
};
Stability is not an issue because the sorting should be done only on key and it is guaranteed that no two keys will have the same value.
EDIT:
While looking for sorting algorithms i read that pointers make it much faster for the sorting algorithm. And considering the huge size of the array I would be happy to have it. But i dont know if i have to change the structure for that to happen.
The size of the array is expected to be between 1000 and 2000 and the distribution of its elements is totally random.
I would say quick sort or merge sort would be your best bet, though depending on the situation, a insertion sort may work as well. You can read up on other algorithms here:
http://en.wikipedia.org/wiki/Sorting_algorithm