Besides all of that i also post a question on HP Support Community about sorting , mister Horn replied to me and i think that he gave me useful advices but still i don't know how to do these things and how to use that knowledge for solving this - selection sort.
I don't know dear people but I will be very very gratefull if someone knows how to do that because no one replied to me about that when i wrote that I don't know how to do that - I'm thinking about selection sort in HP 50g graphing calculator ( User RPL ).
Ok, here's what you were looking for: A 100% standard User RPL program which uses stack operations to sort a list of numbers using the Insertion Sort algorithm, optimized with a binary search. Two local variables are used, one to store the size of the original list, and one as the counter in the FOR-NEXT loop. In a nutshell, the list is exploded onto the stack, then all the sorting is performed on the stack, and when the stack is all sorted, the numbers on the stack are placed back into a list. Therefore, while the work of sorting is being performed, there are no lists or arrays of any kind either on the stack nor stored in a variable.
Input: List of numbers.
Output: Same list, sorted into ascending order.
Speed: Sorts 128 random reals in 9 seconds; 128 random integers in 35 seconds.
This program is useful only for study purposes, since the built-in SORT command (which uses the same logic as this program) is roughly 8 times faster.