Software Lessons Session 23: Programming in C++: Data Structures and Sorting Algorithm Examples
Software Lessons Session 23: Programming in C++: Data Structures and Sorting Algorithm Examples
-Data Structure Examples
--Vectors (basically a dynamic array)
--Ordered Maps (key-value pair)
--Unordered Maps (key-value pair)
--Hash Maps (key-value pair)
--Set (unique, ordered elements)
--Queue (first in, first out)
--Stack(last in, first out)
--Deque (double-ended queue)
--Pair (first and second element)
--struct (custom data structures)
-Sorting Algorithm Examples
--Bubble Sort = O(n^ 2) (swap higher and lower if required)
--Selection Sort = O(n^ 2) (select the min, and put it in the front)
--Merge Sort = O(n log n) (recursive split, comparison, and swap)
--And the many other sorting algorithms...