o0101 / cs.js

Computer Science Data Structures and Algorithms in JavaScript ( Node.JS, ES ) in simple, clean, reusable code
https://npmjs.com/package/cs101
GNU Affero General Public License v3.0
88 stars 0 forks source link

Add #3

Open o0101 opened 3 years ago

o0101 commented 3 years ago

Bubble sort Heap sort Table listing best, average and worst case complexity for everything

o0101 commented 3 years ago

Selection sort , like insertion sort but reversed. insertion sort finds the correct location in the sorted list to insert the next element from the unsorted list or a selection sort finds the largest element from the unsorted list and inserts it into the end of the sorted list

o0101 commented 3 years ago

Categorize into the N squared class and the n log n class, then sort within those classes for practical performance and provide benchmarks from tests (average of 50 runs) on a standard 1000 or 10,000 item list

Also deal with space complexity categorizing into the N, N log n and 1 class and sort within those classes if possible

o0101 commented 3 years ago

Tree sort

o0101 commented 2 years ago

Crit-bit trees - Best of both worlds: hash and heap. Insertion, deletion, and exact search. Plus find minimum and general suffix search.

One example ref: http://cr.yp.to/critbit.html