Yes, it's very disgusting to wait like a minute to see that what's my balance position ***THIS THREAD MAYBE VERY LONG*** So first, I go out seeing that /baltop is in what plugin. I searched Google and finded that it's in plugin called "essentials" then, I enter Github and lookup for the baltop command in this "essentials" plugin and see which sorting technique that he used. link to essentials plugin on github: https://github.com/essentials/Essentials Then I found that this plugin used the java Object Ordering, Which used to be very slow because it use the Selection Sort sorting Technique. Java Object Ordering: https://docs.oracle.com/javase/tutorial/collections/interfaces/order.html which is used to be slower than the sorting technique that I would suggest: Merge Sort Q: What is the Selection Sort? A: https://en.wikipedia.org/wiki/Selection_sort this use up big O of n^2 time Q:What is Merge Sort? A: https://en.wikipedia.org/wiki/Merge_sort this use up big O of n ln n time selection sort implement in python: Spoiler: CODE def selectionSort(alist): for fillslot in range(len(alist)-1,0,-1): positionOfMax=0 for location in range(1,fillslot+1): if alist[location]>alist[positionOfMax]: positionOfMax = location temp = alist[fillslot] alist[fillslot] = alist[positionOfMax] alist[positionOfMax] = temp alist = raw_input().split() for i in range(len(alist)): alist = int(alist) selectionSort(alist) print(alist) merge sort implement in python: Spoiler: CODE def merge_sort(li): if len(li)<2:return li m = len(li)/2 return merge(merge_sort(li[:m]), merge_sort(li[m:])) def merge(l, r): result =[] i = j =0 while i < len(l)and j < len(r): if l< r[j]: result.append(l) i +=1 else: result.append(r[j]) j +=1 result += l[i:] result += r[j:] return result which you can see, The merge sort is program harder than the selection sort but as I said It's Much faster There's about 230000 value to compare on prison ,but lets see the test with 10000 value on list Selection Sort: Merge Sort: see? the different ABOUT 6 SECOND but which one use more RAM? I can said the Merge one Why? because it's have to call the merge function again and again until it go down and have only 1 list member, So it have to remember the parameter of function that calling so please, @Kris @aXed @ItsmeSteyn @CyrusTheVirus1 and staff I known @TheMauriKids @ItsAmethyst maybe considered and you can fork the repository from essential plugin and modified it root : (Essentials/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java) Spoiler I'm trying to modified it here https://github.com/Theerapak/Essentials Spoiler: IMPORTANT the code that I implement is not java! it's python so dont copy and place it . The java and python have very different syntax! thank for reading! my IGN:TheerapakGomolma I forget Python : www.python.org and Python coding program called VIDLE for VPython : http://www.vpython.org/vidle/index.html I used python 2.7 and vidle 2.x cause my Teacher at school (Gifted Computer : A lesson for who talent at computer) teaching Python 2.7
Incorrect, Java uses an modified version of merge sort in it's Collections.sort. See the javadocs here;
and also as I said the Merge sort is not good with memory there's also heap sort but it's less atability Or we need to clear out people data that doesn't on for like a year.