Sorting of uchar array of a million elements with sorted indices?
See original GitHub issueHi @DragonSpit
What to you suggest the best algorithm for sorting a ‘uchar array’ of a million elements and getting sorted indices?
e.g.
uchar data[10] = {2,8,6,25,255,23,96,102,235,0}; // actual one has million values
Output:
{4, 8, 7, 6, 3, 5, 1, 2, 0, 9}
Issue Analytics
- State:
- Created 5 years ago
- Comments:16 (9 by maintainers)
Top Results From Across the Web
Is there an easy way to sort an array of char*'s ? C++
I've got an array of char* in a file. The company I work for stores data in flat files.. Sometimes the data is...
Read more >How to sort a big array with many repetitions?
1) Create an empty AVL Tree with count as an additional field. 2) Traverse input array and do following for every element 'arr[i]'...
Read more >Java.util.Arrays.sort() Method
Arrays.sort(char[] a, int fromIndex, int toIndex) method sorts the specified range of the specified array of chars into ascending numerical order.
Read more >Sorting Algorithms Explained with Examples in JavaScript, ...
Insertion sort and quick sort are in place sorting algorithms, as elements are moved around a pivot point, and do not use a...
Read more >Sorting Algorithms in Python
In this tutorial, you'll learn all about five different sorting algorithms in Python ... It took 73 seconds to sort the array with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve implemented the function you’re after, with an input of unsigned byte array and the output of sorted indexes. The function is SortRadixReturnIndexes(). Look for it at the bottom of RadixSort.cs source file in the HPCsharp folder. I have not tested it yet - will test it this weekend. Just wanted to give you a head start of thinking about porting it from C# to C++, which should be pretty simple, since the function is self contained and doesn’t call any other functions and uses nothing but arrays.
You’re welcome. Yours is a very nice solution also, as it comes with the same realization that we need to reflect something (i.e. go backwards). Both should perform nearly the same.