There are 2 questions here
- sorting algorithms?
- Java or C++;
When you are considering millions of entries then you want to avoid the selection sort, bubble sort etc as these work in at O(n
2) speed which means the time to sort them proportional to the square of the number of elements in the array i.e. doubling the array size quadruples the time to sort. A possibility is the Quick Sort O(n log
2n) which is very fast.
The alternative is to maintain the data in a
sorted data structure for example a Binary Search Tree (self balancing) or If the data is held on disc you might consder a
B Tree structure
C++ is invariably faster than Java.
I'm trying to sort, adjust, count on vertexes
I assume that you mean a position in 3D space. Now to sort the data elements it must be possible to compare two elements and determine if they are
equal or if one is
greater/lesser than the other. So how planning on comparing two vertex positions?