VM
VM
Vineeth Menon wrote:Hey,
Thanks for the response mate. I guess you are mentioning the java.util.Arrays.sort way right? I am trying to sort without using any inbuilt functions.
~ Mansukh
Vineeth Menon wrote:Thanks for the response mate. I guess you are mentioning the java.util.Arrays.sort way right? I am trying to sort without using any inbuilt functions.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Mansukhdeep Thind wrote:
Vineeth Menon wrote:
Then you have to work out some algorithm which sorts the characters. Internally, different versions of Arrays.sort() use different algorithms such as merge-sort /quick-sort etc.
What is the sorting method used in Arrays.sort() and Collections.sort() methods..?
Ramesh-X
Ramesh Pramuditha Rathnayake wrote:What is the sorting method used in Arrays.sort() and Collections.sort() methods..?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Ramesh-X
Winston Gutkowski wrote:
Beyond that, the only thing I can suggest is to either use List methods directly or use arrays. Right now, you're converting a String to a List, then a List to an array to sort it, then...well, to be honest, I'm not quite sure what you are doing with the result; you appear to be creating a single character.
Also, if this is simply an exercise in writing a sort, concentrate on that. Forget about Strings and converting and start out with a List (or array) of Characters, and write a method to sort that. Once you've got it working, then is the time to worry about converting it to and from Strings.
Winston
VM
Vineeth Menon wrote:I was thinking to implement a QuickSort... but my ultimate question is would sorting be done best by ASCII value or is there are better way that using ASCII (sorry if was a dumb question )
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
So, back to my point: If you want to implement a Quicksort, concentrate on that and get it working before you think about anything else.
VM
You may have just won ten million dollars! Or, maybe a tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|