---- v32_bubble_sort.mkv Examples: bubble_sort.cpp What happened to finding memory bugs? We'll wait for an example Let's make a sorting algorithm comparison program! Sorting intro: Bubble Sort Quick demo that sorts integers O runtime of bubble sort ---- v33_qsort_library_function.mkv Examples: qsort_demo.cpp Here's an example of a function that can sort any type C style Demo with integers Demo with strings This contained our first memory error finding demo! ---- v34_generic_sort_library.mkv Examples: sort_test.cpp sort_library.h A generic sorting library: We can use auto& to pass an array by reference Operator < needs to be defined on our data type This only works with C++20 and later Bubble Sort ---- v35_selection_sort How selection sort works Implementing selection sort Speed comparison with bubble sort: It's O(n^2) even with a sorted array Does beat bubble sort by a lot in our speed test though! ---- v36_swap_with_classes.mkv Our swap function works great with basic types But it calls constructors and destructors when swapping classes! Very inefficient with string, etc. memcpy: Just copy memory, don't ask any questions We can avoid the constructor and destructor calls this way Some function call overhead (the optimizer will probably take care of this) I did not do a speed benchmark with non-primitive type ---- Quicksort (messed up the video on this, it'll be up later) ---- Mergesort (maybe, time permitting, I do want to get on to trees) Add this to our generic library Speed comparison