Hello Everyone.
Just a couple of questionsn i wanted to know.

can someone explain what is meant by an index array and why its use can improve the efficiency of sorting?

Can someone give me a more efficient verson of the sort algorithm below with
reasons why its more efficient??

for (int p = 0; p<n-1; p++)
for (int counter = 0;counter < n-1; counter++)
if (a[counter]> a[counter+1])
swap(a, counter, counter+1);

All help apreciated.

index array, if i am not mistaken, simply holds, positions of each elements, so when you are working with sorting, you just change the order of positions of elements...
so it makes sorting faster...

well this sorting is bouble sort...
it is a very slow, because it compares with everything in the array,
you can google these sorting algorithms quick ,merge, they are pretty fast :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.