Omni Calculator logo

Calculating the order of numbers is a rather mundane task, but creating a list of many of them, maybe writing it on paper, can take some attempts! This is why we created this handy ordering numbers calculator.

Calculating the order of numbers: the human way

Humans are particularly good at sorting items, numbers, letters, and more complex quantities like weight, length, angles, and so on. We can do it with a mixture of analytical skills, logic, and intuition.

Therefore, it's impossible to describe a generic algorithm we use to sort items. Take this list of numbers:

{58,2,149,6,73,12,18}\{58,2,149,6,73,-12,18\}

You may take the 22 as the first number, ignore the 5858 (but remember that it's somewhere there), and see the 149149 and decide that it's okay at the end of the list. You may remember the 5858 when you meet the 7373, and right after, you'd find the only negative number of the list, and place it at the beginning, maybe hoping that nothing smaller will appear. Numbers enter and exit your memory as you place them, while the list somehow gets completed. A list of items extracted by a finite set is even easier to sort, as we can place items on two sides.

But even the fastest human has to bow in front of the sorting skills of computers.

How do computers order numbers: sorting algorithms

Computers sort arrays (usually of numbers) using one of many possible algorithms. Just for fun, let's see some of them.

Insertion sort

In the insertion sort algorithm, we compare one element at a time to the ones we placed in an ordered list that grows with time. We follow this algorithm:

  1. We place the first element in the ordered array.
  2. We take the second element and compare it with the one in the ordered array. If smaller, we place it on the left; if larger, on the right.
  3. We take the third element of the array and compare it with the rightmost element in the ordered array; if larger, we place it at the end; if smaller, we compare it with the previous element of the array and follow the same rules (if larger, we put it there, if smaller we move it to the left).
  4. Repeat these steps until all elements of the original array are considered.

Admittedly, this is not an efficient sorting algorithm, but it works!

Bubble sort

Bubble sort considers a pair of elements of the array to be ordered, from left to right. If the pair is not in order, it switches the element. The algorithm then shifts one position and repeats the process. Once it reaches the end of the array, it restarts from the beginning. The algorithm stops when it doesn't perform any switch during the passage over the array.

Merge sort

In this algorithm, the list is split into single elements that are then combined in ordered sublists, starting from length 2, and merged into larger, ordered lists until the final order is achieved. At every merging step, the algorithm picks the list's minimum value and compares it with that already sorted.

Computer scientists are still researching sorting algorithms, aiming to achieve the purpose in the smallest possible time (number of operations) or with the lowest consumption of resources.

How to use our ordering number calculator

To use our ordering number calculator, simply start inserting numbers in the fields. If you need more numbers, more fields will appear. You can sort up to 50 numbers!

FAQ

How do I sort numbers in ascending order?

To sort numbers in ascending order:

  1. Take your unordered list.
  2. Compare the first element with the second one. If they are not in order, switch their positions.
  3. Compare the second element with the third one. If they are not in order, switch their positions.
    • Compare now the third element with the first one: if they are in the wrong order, invert them.
  4. Proceed with the comparison. Eventually, at the end of the list, you may have to compare the number with all the elements of the list.

This is a relatively inefficient way to sort a list!

How can I sort a long list of numbers in an efficient way?

To sort a long list of numbers quickly and without errors, you can use a paper-and-pen implementation of the bubble sort algorithm.

  1. Take the first pair of elements of the list. Switch their position if they are not in order.
  2. Move one element to the right and perform the same operation.
  3. Once you reach the end of the list, start again from the beginning.
  4. The list is ordered when you don't have to perform any switches!

How do I sort the list {4,7,1,9,3,6,2} using bubble sort?

To sort the list {4,7,1,9,3,6,2} with bubble sort:

  1. Take the first pair of elements: {4,7}. It's in order; move on.
  2. Take the second pair: {7,1}. Switch them: {1,7}.
  3. Move on: the next pair is {7,9}; leave it.
  4. Next one, {9,3}: switch it ({3,9}).
  5. Proceed: {9,6} becomes {6,9}.
  6. Final pair: {9,2} becomes {2,9}.

The result is: {4,1,7,3,6,2,9}.
Repeat the procedure: you'll get this array: {1,4,3,6,2,7,9}. From here, you'll meet:

  1. {1,3,4,2,6,7,9}.
  2. {1,3,2,4,6,7,9}.
  3. Finally, the last switch would give you: {1,2,3,4,6,7,9}.
Davide Borchia
Order
ascending
Values (enter up to 50 numbers)
#1
#2
#3
#4
#5
#6
#7
#8
Check out 44 similar descriptive statistics calculators 📊
5 number summary5★ rating averageCoefficient of variation… 41 more
People also viewed…

Black hole collision

The Black Hole Collision Calculator lets you see the effects of a black hole collision, as well as revealing some of the mysteries of black holes, come on in and enjoy!

Decimal random number generator

This decimal random number generator can output sequences of uniformly distributed random numbers from any given range.

Dice roller

Use this dice roller calculator when you've lost the dice to your favorite board game. Throw up to 15 dice of twenty different types.

Free fall

Our free fall calculator can find the velocity of a falling object and the height it drops from.
Copyright by Omni Calculator sp. z o.o.
Privacy, Cookies & Terms of Service