Javascript Sorting Algorithm

Sorting is a technique to arrange item to Increasing or Decreasing order

Sorting of item done by comparison of another item or element

 Sort Single Dimensional Array 

Single Dimensional Array have sorted by javascript sort method

javascript single dimension array

Single dimension array sorting output

1-D array output

 Sorting  Multidimension Array

Multidimensional array sorted using  array sort() method

Multidimensional array sorted on the basis of column index number

In below image we sort array on the basis of third column  or element ( 2 index ) of inner array  

multidimension array sorted output

Output of multidimension array sorting

multidimension array sorted output

Related Articals

How to make div align center | align div center