Bubble sort, select sort, and insert sort complexity are all points of magnitude, put together to say.
This article introduces some of the better materials for learning these three sorting methods. Bubble sort See "learning JavaScript Data structure and algorithm" Introduction of bubble sort, select sort See "Introduction to Computer Science (third edition)" in the selection of sorting, insert sort See "Introduction to Computer Science (11th edition)" Introduced in the insertion sort,
After the three data to figure out the implementation of the principle, the last look at the "Learning JavaScript data structure and algorithm" in the book JS implementation code.
Well, this book has a ready-made code, not here to write, the key is to figure out the principle, and then the JS code two times a day, OK.
JavaScript algorithm (bubble sort, select sort and insert sort)