Sorting Flashcards
what are the 3 sorting algorithms?
bubble
insertion
merge
what is bubble sort?
this sorting method is where the algorithm compares the 2 adjacent items in a list and swaps them accordingly. this process will continue and more passes will be done until there is a pass where no swaps are made
what is insertion sort?
is a sorting algorithm that sorts by creating and inserting the next value into the correct place before moving on to the next value
what is merge sort?
a sorting method where the list is divided into sublists containing one item each before comparing the individual sublists and joining them together until one large sorted list is created
what are some benefits and negatives of bubble sort?
works well on small lists but is the slowest
what are some benefits and negatives of insertion?
more efficient than bubble sort
slower than merge sort
what are some benefits and negatives of merging sort?
fastest method
complicated to program