JS Sort Algorithms
Name | JS Sort Algorithms |
Author | Pi Ke |
Type | Source Code |
Size | 1.48 KB |
Date | 2011-07-29 10:54:00 |
Downloads | 18 |
Tag | Sort,Algorithm,Quicksort,Mergesort,Inser |
::Description
This source code is to implement five popular sorting algorithms with JavaScript. It will help us to understand not only different kinds of sorting algorithms but also the power of JavaScript.
The five sorting algorithms implemented are :
Quicksort : Quick sort algorithm. It is a very fast sorting algorithm for relative complex array but in small set of values, the advantage of quick sort will not be so obvious. The complexity is O(nlogn)
Insertion Sort : Insertion sort algorithm. It is to sort a set of values by inserting unsorted elements into a sorted array. It is much less efficient on large lists than more advanced algorithms such as quicksort. Complexity is in average
Selection sort : Selection sort algorithm. It is to sort a set of values by finding the minimum value first and put it in the appropriate position. Complexity is in average
Merge sort : Merge sort algorithm. It is to sort a set of values by diving and conquering the array and finally merge the sorted array into a single array. Complexity is in average
Bubble sort : Bubble sort algorithm. It is to sort a set of values by putting the max or min value to one end in one loop. Complexity is in average
Hope you can learn something from this code.
The five sorting algorithms implemented are :
Quicksort : Quick sort algorithm. It is a very fast sorting algorithm for relative complex array but in small set of values, the advantage of quick sort will not be so obvious. The complexity is O(nlogn)
Insertion Sort : Insertion sort algorithm. It is to sort a set of values by inserting unsorted elements into a sorted array. It is much less efficient on large lists than more advanced algorithms such as quicksort. Complexity is in average
Selection sort : Selection sort algorithm. It is to sort a set of values by finding the minimum value first and put it in the appropriate position. Complexity is in average
Merge sort : Merge sort algorithm. It is to sort a set of values by diving and conquering the array and finally merge the sorted array into a single array. Complexity is in average
Bubble sort : Bubble sort algorithm. It is to sort a set of values by putting the max or min value to one end in one loop. Complexity is in average
Hope you can learn something from this code.
(Views : 4355 Downloads : 18 )
::User say
No comment for this article.
::Comment
Comment is disabled on this page
Most updated
5 downloads 1 comments | |
7 downloads 1 comments | |
3 downloads 1 comments | |
5 downloads 1 comments |
Most downloaded
79 downloads 1 comments | |
48 downloads 1 comments | |
18 downloads 1 comments | |
15 downloads 1 comments | |
10 downloads 1 comments |
Most viewed
10 downloads 1 comments | |
15 downloads 1 comments | |
7 downloads 0 comments | |
79 downloads 1 comments |
Most commented
8 downloads 3 comments | |
48 downloads 1 comments | |
9 downloads 1 comments | |
8 downloads 1 comments | |
6 downloads 1 comments |