Mar
19
Basic Sorting and Bubble Sort
Basic Sorting
When we have a few objects be it of any kind, and we want to sort them this means that we want to rearrange them somehow so that they follow some order, an order that we define. We can take for example one of the fields, for example if we have sheep, and each sheep has a name, and we want to order the sheep by name then we could just take any sheep and first place the sheep named Avida, and then take the sheep named Guliantra and so on, lexicographically.
Respectively we could sort the sheep that we have by their age, and in this case Guliantra could end up before Avida.
In computer algorithms, sorting is the like the basic algorithms, and you will find that to solve many other problems you would start by first sorting and then progress to actually solve the problem.
When we have a few objects be it of any kind, and we want to sort them this means that we want to rearrange them somehow so that they follow some order, an order that we define. We can take for example one of the fields, for example if we have sheep, and each sheep has a name, and we want to order the sheep by name then we could just take any sheep and first place the sheep named Avida, and then take the sheep named Guliantra and so on, lexicographically.
Respectively we could sort the sheep that we have by their age, and in this case Guliantra could end up before Avida.
In computer algorithms, sorting is the like the basic algorithms, and you will find that to solve many other problems you would start by first sorting and then progress to actually solve the problem.