I'm working on my own sorting algorithm.
This is what i have so far. (I want to make it as basic as possible)
quantity is the length of the list.
pointer is the place where 'int i' is placed when found.
int j makes a traverse over list.
temporaries is a list where the replaced int's go to.
void Fluxinterflowsort()
{
int pointer = 0;
for (int i = 0; i < quantity; i++)
{
for (int j = 0; j < quantity; j++)
{
if (i == list[j])
{
temporaries[pointer] = list[pointer];
list[pointer] = i;
pointer += 1;
}
if (i == lijst[j])
{
temporaries[pointer] = list[pointer];
list[pointer] = i;
pointer += 1;
}
}
}
}
This is the array before the sorting:
8
3
1
6
3
5
9
6
6
8
This is the array after the sorting:
1
1
3
3
5
5
6
6
6
6
The problem i came across was a duplication of numbers in the final result.
And i'm missing a couple of integers.
Can anybody see what i did wrong?