Comparison of O(n2) algorithms (Selection Sort + Merge Sort). Three cases are tested:
- Standard Selection Sort
- Standard Merge Sort
- Merge Sort with Selection Sort when the subarrays are small enough
Large integer multiplication, where the result is too large to be stored in regular integer data types. Strings + Vectors are used to represent these large numbers
Finds the minimum spanning tree of an undirected graph, given as an adjacency matrix using Prim's Algorithm
One thing to note, this version of Prim's is NOT using a binary heap. This is the standard O(|V|2) implementation using an adjacency matrix (which is more rare I think?). Check out the code if you're looking for help on how to implement Prim's using an adjacency matrix.
Implements a greedy algorithm for accommodating bookings in a hotel with N rooms
Finds an optimal solution to the 0/1 Knapsack problem. Two functions are implemented:
- The brute force method O(2n)
- Dynamic method O(nW) where n = # of items, W = capacity of knapsack