Hello I wonder if there is any sorting algorithm similar to qsort that would also remove duplicate indexes. 

Here is problem.

This is input:

```
array[0]->["astr"]
array[1]->["zstr"]
array[2]->["cstr"]
array[3]->["astr"]
array[4]->["zstr"]

```

Here's my sorting algorithm:

```
int compare(const void *u, const void *h) {
    const char **iu = (const char **) u;
    const char **ih = (const char **) h;
    return strcasecmp(*iu, *ih);
}

...
qsort(array, n, sizeof (char *), compare);

```

Output is :

```
array[0]->["astr"]
array[1]->["astr"]
array[2]->["cstr"]
array[3]->["zstr"]
array[4]->["zstr"]

```

What i need is :

```
array[0]->["astr"]
array[1]->["cstr"]
array[2]->["zstr"]

```

I could try to read whole array in for cycle and test every index if it is same as the next one and then realloc new array where i would store only unique words but this is very slow so i need to find sorting algorithm that would do this for me faster than i can.