Jump to content
UBot Underground

Sorting list items


Recommended Posts

Hello, i have problems sorting a list of integers by magnitude, actually the code has to work only with the first 6 digits which is easily accomplished by the javascript toPrecision() method. I had couple ideas how to do it, first using the javascript array.sort() method, using the list as an array. That didn't work so now i'm trying to implement a variant of the bubble sorting algorithm, but i'm a bit stuck ... i don't know how to add items to a desired list position. If someone has a idea, or even better an already made solution, please let me know.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...