Clean up CMakeLists in all C++ examples
+ Rename output executables to match directory structure + Remove libraries for small examples + Supress -Wreturn-type warnings for singleton that is intentionally not copyable
This commit is contained in:
parent
573fc4e1e8
commit
a97dfbe34b
|
@ -1,13 +1,13 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A root project for practicing C++ ##
|
## About: A root project for practicing C++ ##
|
||||||
## This project can be built to debug and run all nested projects ##
|
## This project can be built to debug and run all nested projects ##
|
||||||
## Or, any subdirectory with a project() statement can be selected ##
|
## Or, any subdirectory with a project() statement can be selected ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project(
|
project(
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A root project for practicing algorithms in C++ ##
|
## About: A root project for practicing algorithms in C++ ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project (
|
project (
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A root project for practicing graph algorithms in C++ ##
|
## About: A root project for practicing graph algorithms in C++ ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project (
|
project (
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A root project for practicing graph algorithms in C++ ##
|
## About: A root project for practicing graph algorithms in C++ ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
|
@ -16,7 +15,7 @@ project(
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(lib-graph-object "lib-graph.cpp")
|
add_executable(
|
||||||
|
algo-graphs-object graph.cpp
|
||||||
add_executable(graph-test-object "graph.cpp")
|
lib-graph.cpp lib-graph.hpp
|
||||||
target_link_libraries(graph-test-object lib-graph-object)
|
)
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A CMakeLists configuration to test a simple graph implementation ##
|
## About: A CMakeLists configuration to test a simple graph implementation ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
|
@ -16,7 +15,7 @@ project(
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(lib-graph-simple "lib-graph.cpp")
|
add_executable(
|
||||||
|
algo-graphs-simple graph.cpp
|
||||||
add_executable(graph-test-simple "graph.cpp")
|
lib-graph.cpp lib-graph.hpp
|
||||||
target_link_libraries(graph-test-simple lib-graph-simple)
|
)
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A basic CMakeLists to test templated graph implementation ##
|
## About: A basic CMakeLists to test templated graph implementation ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
|
@ -16,7 +15,4 @@ project(
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
#add_library(lib-graph-templated "lib-graph.cpp")
|
add_executable(algo-graphs-templated graph.cpp)
|
||||||
|
|
||||||
add_executable(graph-test-templated "graph.cpp")
|
|
||||||
#target_link_libraries(graph-test-templated lib-graph-templated)
|
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
/*##############################################################################
|
|
||||||
## Author: Shaun Reed ##
|
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
|
||||||
## About: Driver program to test object graph implementation ##
|
|
||||||
## ##
|
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
|
||||||
################################################################################
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "lib-graph.hpp"
|
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A basic CMakeLists configuration to test RBT implementation ##
|
## About: A basic CMakeLists configuration to test RBT implementation ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
|
@ -16,7 +15,7 @@ project(
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(lib-graph-weighted "lib-graph.cpp")
|
add_executable(
|
||||||
|
algo-graphs-weighted graph.cpp
|
||||||
add_executable(graph-test-weighted "graph.cpp")
|
lib-graph.cpp lib-graph.hpp
|
||||||
target_link_libraries(graph-test-weighted lib-graph-weighted)
|
)
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A root project for practicing sorting algorithms in C++ ##
|
## About: A root project for practicing sorting algorithms in C++ ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project (
|
project (
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A basic CMakeLists configuration to practice bubble sort ##
|
## About: A basic CMakeLists configuration to practice bubble sort ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(BubbleSort LANGUAGES CXX)
|
project(BubbleSort LANGUAGES CXX)
|
||||||
|
|
||||||
add_executable(bubble-sort "bubble-sort.cpp")
|
add_executable(
|
||||||
|
algo-sort-bubble bubble-sort.cpp
|
||||||
add_library(lib-bubble "lib-bubble.cpp")
|
lib-bubble.cpp lib-bubble.hpp
|
||||||
target_link_libraries(bubble-sort lib-bubble)
|
)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of bubble sort using a custom library ##
|
## About: An example implementation of bubble sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of bubble sort using a custom library ##
|
## About: An example implementation of bubble sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of bubble sort using a custom library ##
|
## About: An example implementation of bubble sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A basic CMakeLists configuration to practice bucket sort ##
|
## About: A basic CMakeLists configuration to practice bucket sort ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(BucketSort LANGUAGES CXX)
|
project(BucketSort LANGUAGES CXX)
|
||||||
|
|
||||||
add_executable(bucket-sort "bucket-sort.cpp")
|
add_executable(
|
||||||
|
algo-sort-bucket bucket-sort.cpp
|
||||||
add_library(lib-bucket "lib-bucket.cpp")
|
lib-bucket.cpp lib-bucket.hpp
|
||||||
target_link_libraries(bucket-sort lib-bucket)
|
)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of bucket sort using a custom library ##
|
## About: An example implementation of bucket sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of bucket sort using a custom library ##
|
## About: An example implementation of bucket sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of bucket sort using a custom library ##
|
## About: An example implementation of bucket sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A basic CMakeLists configuration to practice counting sort ##
|
## About: A basic CMakeLists configuration to practice counting sort ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(CountingSort LANGUAGES CXX)
|
project(CountingSort LANGUAGES CXX)
|
||||||
|
|
||||||
add_executable(counting-sort "counting-sort.cpp")
|
add_executable(
|
||||||
|
algo-sort-counting counting-sort.cpp
|
||||||
add_library(lib-counting "lib-counting.cpp")
|
lib-counting.cpp lib-counting.hpp
|
||||||
target_link_libraries(counting-sort lib-counting)
|
)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of counting sort using a custom library ##
|
## About: An example implementation of counting sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of counting sort using a custom library ##
|
## About: An example implementation of counting sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
@ -35,13 +35,17 @@ void CountingSort(std::vector<int> &array)
|
||||||
// + Since each element stores its own count, just add the count at index i-1
|
// + Since each element stores its own count, just add the count at index i-1
|
||||||
for (size_t i = 1; i <= maxValue; i++) {
|
for (size_t i = 1; i <= maxValue; i++) {
|
||||||
tempArray[i] += tempArray[i - 1];
|
tempArray[i] += tempArray[i - 1];
|
||||||
|
// tempArray[i] - 1 now represents the sorted 0-index pos for each value i
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Step through the array from right-to-left and place each value in their pos
|
||||||
|
// + As we run into values lookup their position with tempArray[value]
|
||||||
for (ssize_t arrayIndex = array.size() - 1; arrayIndex >= 0; arrayIndex--) {
|
for (ssize_t arrayIndex = array.size() - 1; arrayIndex >= 0; arrayIndex--) {
|
||||||
// Store as references; Changes reflect on actual values within each array
|
|
||||||
const int &arrayValue = array[arrayIndex];
|
const int &arrayValue = array[arrayIndex];
|
||||||
|
// Store as reference; Changes to valueCount reflect within tempArray
|
||||||
int &valueCount = tempArray[arrayValue];
|
int &valueCount = tempArray[arrayValue];
|
||||||
sortedArray[valueCount - 1] = arrayValue;
|
sortedArray[valueCount - 1] = arrayValue;
|
||||||
|
// Subtract from tempArray[arrayValue] to update position of next occurrence
|
||||||
valueCount = valueCount - 1;
|
valueCount = valueCount - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of counting sort using a custom library ##
|
## About: An example implementation of counting sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(HeapSort LANGUAGES CXX)
|
project(HeapSort LANGUAGES CXX)
|
||||||
|
|
||||||
add_executable(heap-sort "heap-sort.cpp")
|
add_executable(
|
||||||
|
algo-sort-heap heap-sort.cpp
|
||||||
|
lib-heap.cpp lib-heap.hpp
|
||||||
|
)
|
||||||
|
|
||||||
add_library(lib-heap "lib-heap.cpp")
|
|
||||||
target_link_libraries(heap-sort lib-heap)
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of heap sort using a custom library ##
|
## About: An example implementation of heap sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of heap sort using a custom library ##
|
## About: An example implementation of heap sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of heap sort using a custom library ##
|
## About: An example implementation of heap sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,15 +1,21 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A basic CMakeLists configuration to practice insertion sort ##
|
## About: A basic CMakeLists configuration to practice insertion sort ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
###############################################################################
|
################################################################################
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(InsertionSort LANGUAGES CXX)
|
|
||||||
|
|
||||||
add_executable(insertion-sort "insertion-sort.cpp")
|
project (
|
||||||
|
#[[NAME]] InsertionSort
|
||||||
|
VERSION 1.0
|
||||||
|
DESCRIPTION "A project for practicing insertion sort in C++"
|
||||||
|
LANGUAGES CXX
|
||||||
|
)
|
||||||
|
|
||||||
add_library(lib-insertion "lib-insertion.cpp")
|
add_executable(
|
||||||
target_link_libraries(insertion-sort lib-insertion)
|
algo-sort-insertion insertion-sort.cpp
|
||||||
|
lib-insertion.cpp lib-insertion.hpp
|
||||||
|
)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of insertion sort using a custom library ##
|
## About: An example implementation of insertion sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of insertion sort using a custom library ##
|
## About: An example implementation of insertion sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
#include "lib-insertion.hpp"
|
#include "lib-insertion.hpp"
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
void InsertionSort(std::vector<int> &array)
|
void InsertionSort(std::vector<int> &array)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of insertion sort using a custom library ##
|
## About: An example implementation of insertion sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,15 +1,21 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2020 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A basic CMakeLists configuration to practice merge sort ##
|
## About: A basic CMakeLists configuration to practice merge sort ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
###############################################################################
|
################################################################################
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.17)
|
||||||
project(MergeSort LANGUAGES CXX)
|
|
||||||
|
|
||||||
add_executable(merge-sort "merge-sort.cpp")
|
project (
|
||||||
|
#[[NAME]] MergeSort
|
||||||
|
VERSION 1.0
|
||||||
|
DESCRIPTION "A project for practicing merge sort in C++"
|
||||||
|
LANGUAGES CXX
|
||||||
|
)
|
||||||
|
add_executable(
|
||||||
|
algo-sort-merge merge-sort.cpp
|
||||||
|
lib-merge.cpp lib-merge.h
|
||||||
|
)
|
||||||
|
|
||||||
add_library(lib-merge "lib-merge.cpp")
|
|
||||||
target_link_libraries(merge-sort lib-merge)
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of merge sort using a custom library ##
|
## About: An example implementation of merge sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of merge sort using a custom library ##
|
## About: An example implementation of merge sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of merge sort using a custom library ##
|
## About: An example implementation of merge sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,15 +1,21 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A basic CMakeLists configuration to practice quick sort ##
|
## About: A basic CMakeLists configuration to practice quick sort ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
###############################################################################
|
################################################################################
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(QuickSort LANGUAGES CXX)
|
|
||||||
|
|
||||||
add_executable(quick-sort "quick-sort.cpp")
|
project (
|
||||||
|
#[[NAME]] QuickSort
|
||||||
|
VERSION 1.0
|
||||||
|
DESCRIPTION "A project for practicing quick sort in C++"
|
||||||
|
LANGUAGES CXX
|
||||||
|
)
|
||||||
|
|
||||||
add_library(lib-quick "lib-quick.cpp")
|
add_executable(
|
||||||
target_link_libraries(quick-sort lib-quick)
|
algo-sort-quick quick-sort.cpp
|
||||||
|
lib-quick.cpp lib-quick.hpp
|
||||||
|
)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of quick sort using a custom library ##
|
## About: An example implementation of quick sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of quick sort using a custom library ##
|
## About: An example implementation of quick sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of quick sort using a custom library ##
|
## About: An example implementation of quick sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,17 +1,22 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A basic CMakeLists configuration to practice radix sort ##
|
## About: A basic CMakeLists configuration to practice radix sort ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
###############################################################################
|
################################################################################
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(RadixSort LANGUAGES CXX)
|
|
||||||
|
|
||||||
add_executable(radix-sort "radix-sort.cpp")
|
project (
|
||||||
|
#[[NAME]] RadixSort
|
||||||
|
VERSION 1.0
|
||||||
|
DESCRIPTION "A project for practicing radix sort in C++"
|
||||||
|
LANGUAGES CXX
|
||||||
|
)
|
||||||
|
|
||||||
add_library(lib-radix-counting "lib-counting.cpp")
|
add_executable(
|
||||||
add_library(lib-radix "lib-radix.cpp")
|
algo-sort-radix radix-sort.cpp
|
||||||
|
lib-counting.cpp lib-counting.hpp
|
||||||
target_link_libraries(radix-sort lib-radix lib-radix-counting)
|
lib-radix.cpp lib-radix.hpp
|
||||||
|
)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of counting sort using a custom library ##
|
## About: An example implementation of counting sort using a custom library ##
|
||||||
## + In support of a radix sort implementation ##
|
## + In support of a radix sort implementation ##
|
||||||
## ##
|
## ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of counting sort using a custom library ##
|
## About: An example implementation of counting sort using a custom library ##
|
||||||
## + In support of a radix sort implementation ##
|
## + In support of a radix sort implementation ##
|
||||||
## ##
|
## ##
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
/*#############################################################################
|
||||||
|
## Author: Shaun Reed ##
|
||||||
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
|
## About: An example implementation of radix sort using a custom library ##
|
||||||
|
## ##
|
||||||
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
###############################################################################
|
||||||
|
*/
|
||||||
|
|
||||||
#include "lib-radix.hpp"
|
#include "lib-radix.hpp"
|
||||||
#include "lib-counting.hpp"
|
#include "lib-counting.hpp"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of radix sort using a custom library ##
|
## About: An example implementation of radix sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of radix sort using a custom library ##
|
## About: An example implementation of radix sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,15 +1,21 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A basic CMakeLists configuration to practice selection sort ##
|
## About: A basic CMakeLists configuration to practice selection sort ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
###############################################################################
|
################################################################################
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(SelectionSort LANGUAGES CXX)
|
|
||||||
|
|
||||||
add_executable(select-sort "select-sort.cpp")
|
project (
|
||||||
|
#[[NAME]] SelectionSort
|
||||||
|
VERSION 1.0
|
||||||
|
DESCRIPTION "A project for practicing selection sort in C++"
|
||||||
|
LANGUAGES CXX
|
||||||
|
)
|
||||||
|
|
||||||
add_library(lib-select "lib-select.cpp")
|
add_executable(
|
||||||
target_link_libraries(select-sort lib-select)
|
algo-sort-select select-sort.cpp
|
||||||
|
lib-select.cpp lib-select.h
|
||||||
|
)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of selection sort using a custom library ##
|
## About: An example implementation of selection sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of selection sort using a custom library ##
|
## About: An example implementation of selection sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example implementation of selection sort using a custom library ##
|
## About: An example implementation of selection sort using a custom library ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A root project for practicing algorithms in C++ ##
|
## About: A root project for practicing algorithms in C++ ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project (
|
project (
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A basic CMakeLists configuration to test BST implementation ##
|
## About: A basic CMakeLists configuration to test BST implementation ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project (
|
project (
|
||||||
|
@ -15,7 +15,7 @@ project (
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(lib-bst-algo "bst.cpp")
|
add_executable(
|
||||||
|
algo-trees-bst driver.cpp
|
||||||
add_executable(test-bst-algo "driver.cpp")
|
bst.cpp bst.h
|
||||||
target_link_libraries(test-bst-algo lib-bst-algo)
|
)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example of a binary search tree implementation ##
|
## About: An example of a binary search tree implementation ##
|
||||||
## The algorithms in this example are seen in MIT Intro to Algorithms ##
|
## The algorithms in this example are seen in MIT Intro to Algorithms ##
|
||||||
## ##
|
## ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example of a binary search tree implementation ##
|
## About: An example of a binary search tree implementation ##
|
||||||
## The algorithms in this example are seen in MIT Intro to Algorithms ##
|
## The algorithms in this example are seen in MIT Intro to Algorithms ##
|
||||||
## ##
|
## ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: Driver program to test BST algorithms from MIT intro to algorithms ##
|
## About: Driver program to test BST algorithms from MIT intro to algorithms ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A basic CMakeLists configuration to test RBT implementation ##
|
## About: A basic CMakeLists configuration to test RBT implementation ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project (
|
project (
|
||||||
|
@ -15,7 +15,7 @@ project (
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(lib-redblack "redblack.cpp")
|
add_executable(
|
||||||
|
algo-trees-redblack driver.cpp
|
||||||
add_executable(test-redblack "driver.cpp")
|
redblack.cpp redblack.h
|
||||||
target_link_libraries(test-redblack lib-redblack)
|
)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: Driver program to test RBT algorithms from MIT intro to algorithms ##
|
## About: Driver program to test RBT algorithms from MIT intro to algorithms ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example of a red-black tree implementation ##
|
## About: An example of a red-black tree implementation ##
|
||||||
## The algorithms in this example are seen in MIT Intro to Algorithms ##
|
## The algorithms in this example are seen in MIT Intro to Algorithms ##
|
||||||
## ##
|
## ##
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*#############################################################################
|
/*#############################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example of a red black tree implementation ##
|
## About: An example of a red black tree implementation ##
|
||||||
## The algorithms in this example are seen in MIT Intro to Algorithms ##
|
## The algorithms in this example are seen in MIT Intro to Algorithms ##
|
||||||
## ##
|
## ##
|
||||||
|
|
|
@ -1,19 +1,27 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A template project for getting started working with CMake ##
|
## About: A template project for getting started working with CMake ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
|
|
||||||
# Define the version of CMake
|
# Define the version of CMake
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
|
# CMake options
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||||
|
|
||||||
|
# Compiler options
|
||||||
|
add_compile_options("-Wall")
|
||||||
|
|
||||||
# Define the your project name
|
# Define the your project name
|
||||||
project(cmake-template)
|
project (
|
||||||
|
#[[NAME]] CMakeTemplate
|
||||||
|
VERSION 1.0
|
||||||
|
DESCRIPTION "A basic CMake template for C++ projects"
|
||||||
|
LANGUAGES CXX
|
||||||
|
)
|
||||||
|
|
||||||
# Include any directories the compiler may need
|
# Include any directories the compiler may need
|
||||||
include_directories(./include)
|
include_directories(./include)
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
## This directory is for storing / compiling our executable code
|
## This directory is for storing / compiling our executable code
|
||||||
|
|
||||||
# Create a reference / variable to refer to our source code
|
# Create a reference / variable to refer to our source code
|
||||||
set(APP_SRC say-hello.cpp)
|
set(APP_SRC say-hello.cpp)
|
||||||
|
|
||||||
# Add our executable, naming it and linking it to our source code
|
# Add our executable, naming it and linking it to our source code
|
||||||
add_executable(say-hello ${APP_SRC})
|
add_executable(cmake-example-template ${APP_SRC})
|
||||||
|
|
||||||
# Link to our custom library, defined in c-cmake/src/
|
# Link to our custom library, defined in c-cmake/src/
|
||||||
target_link_libraries(say-hello lib-klips)
|
target_link_libraries(cmake-example-template cmake-example-lib)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <lib-klips.hpp>
|
#include <lib-example.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
int main () {
|
int main () {
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
## This directory is for storing source code
|
## This directory is for storing source code
|
||||||
|
|
||||||
# Create any links we might need
|
# Create any links we might need
|
||||||
set(LIB_SRC lib-klips.cpp)
|
set(LIB_SRC lib-example.cpp)
|
||||||
|
|
||||||
# Define our library within CMake and link to the source code
|
# Define our library within CMake and link to the source code
|
||||||
add_library(lib-klips ${LIB_SRC})
|
add_library(cmake-example-lib ${LIB_SRC})
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <lib-klips.hpp>
|
#include <lib-example.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
void PrintHello(int n) {
|
void PrintHello(int n) {
|
|
@ -1,11 +1,11 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
||||||
## About: A root project for practicing cryptography in C++ ##
|
## About: A root project for practicing cryptography in C++ ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project (
|
project (
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
|
@ -16,7 +15,7 @@ project(
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(lib-cipher "lib-cipher.cpp")
|
add_executable(
|
||||||
|
crypto-columnar-transposition driver.cpp
|
||||||
add_executable(columnar-transposition-test "driver.cpp")
|
lib-cipher.cpp lib-cipher.hpp
|
||||||
target_link_libraries(columnar-transposition-test lib-cipher)
|
)
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A root project for practicing C++ data structure implementations ##
|
## About: A root project for practicing C++ data structure implementations ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project (
|
project (
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A basic CMakeLists configuration to test BST implementation ##
|
## About: A basic CMakeLists configuration to test BST implementation ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project (
|
project (
|
||||||
|
@ -15,7 +15,7 @@ project (
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(lib-bst "bst.cpp")
|
add_executable(
|
||||||
|
data-bst driver.cpp
|
||||||
add_executable(test-bst "driver.cpp")
|
bst.cpp bst.h
|
||||||
target_link_libraries(test-bst lib-bst)
|
)
|
||||||
|
|
|
@ -1,16 +1,21 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example of a circular doubly linked list implementation ##
|
## About: An example of a circular doubly linked list implementation ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
# Define the project name
|
project (
|
||||||
project(CircleDouble)
|
#[[NAME]] CircleDoubleList
|
||||||
# Define source files
|
VERSION 1.0
|
||||||
set(SRC driver.cpp circledoublelist.cpp)
|
DESCRIPTION "Project for testing circular doubly linked list implementation"
|
||||||
# Build an executable
|
LANGUAGES CXX
|
||||||
add_executable(CircleDoubleDriver ${SRC})
|
)
|
||||||
|
|
||||||
|
add_executable(
|
||||||
|
data-circular-doubly-linked-list driver.cpp
|
||||||
|
circledoublelist.cpp circledoublelist.h
|
||||||
|
)
|
||||||
|
|
|
@ -1,16 +1,21 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example of a circular singly linked list implementation ##
|
## About: An example of a circular singly linked list implementation ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
# Define the project name
|
project (
|
||||||
project(CircleSingle)
|
#[[NAME]] CircleSingleList
|
||||||
# Define source files
|
VERSION 1.0
|
||||||
set(SRC driver.cpp circlesinglelist.cpp)
|
DESCRIPTION "Project for testing circular singly linked list implementation"
|
||||||
# Build an executable
|
LANGUAGES CXX
|
||||||
add_executable(CircleSingleDriver ${SRC})
|
)
|
||||||
|
|
||||||
|
add_executable(
|
||||||
|
data-circular-singly-linked-list driver.cpp
|
||||||
|
circlesinglelist.cpp circlesinglelist.h
|
||||||
|
)
|
||||||
|
|
|
@ -1,16 +1,21 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example of a doubly linked list implementation ##
|
## About: An example of a doubly linked list implementation ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
# Define the project name
|
project (
|
||||||
project(DoubleList)
|
#[[NAME]] DoubleList
|
||||||
# Define source files
|
VERSION 1.0
|
||||||
set(SRC driver.cpp doublelist.cpp)
|
DESCRIPTION "A project for testing a doubly linked list implementation"
|
||||||
# Build an executable
|
LANGUAGES CXX
|
||||||
add_executable(DoubleListDriver ${SRC})
|
)
|
||||||
|
|
||||||
|
add_executable(
|
||||||
|
data-doubly-linked-list driver.cpp
|
||||||
|
doublelist.cpp doublelist.h
|
||||||
|
)
|
||||||
|
|
|
@ -1,16 +1,21 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example of a max heap implementation ##
|
## About: An example of a max heap implementation ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
# Define the project name
|
project (
|
||||||
project(MaxHeap)
|
#[[NAME]] MaxHeap
|
||||||
# Define source files
|
VERSION 1.0
|
||||||
set(SRC driver.cpp maxheap.cpp)
|
DESCRIPTION "A project for testing a max heap implementation"
|
||||||
# Build an executable
|
LANGUAGES CXX
|
||||||
add_executable(HeapDriver ${SRC})
|
)
|
||||||
|
|
||||||
|
add_executable(
|
||||||
|
data-max-heap driver.cpp
|
||||||
|
maxheap.cpp maxheap.h
|
||||||
|
)
|
||||||
|
|
|
@ -1,16 +1,21 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example of a queue implementation ##
|
## About: An example of a queue implementation ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
# Define the project name
|
project (
|
||||||
project(Queue)
|
#[[NAME]] Queue
|
||||||
# Define source files
|
VERSION 1.0
|
||||||
set(SRC driver.cpp queuelist.cpp)
|
DESCRIPTION "Project for testing queue implementation"
|
||||||
# Build an executable
|
LANGUAGES CXX
|
||||||
add_executable(QueueDriver ${SRC})
|
)
|
||||||
|
|
||||||
|
add_executable(
|
||||||
|
data-queue driver.cpp
|
||||||
|
queuelist.cpp queuelist.h
|
||||||
|
)
|
||||||
|
|
|
@ -1,16 +1,21 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example of a singly linked list implementation ##
|
## About: An example of a singly linked list implementation ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
# Define the project name
|
project (
|
||||||
project(SingleList)
|
#[[NAME]] SingleList
|
||||||
# Define source files
|
VERSION 1.0
|
||||||
set(SRC driver.cpp singlelist.cpp)
|
DESCRIPTION "A project for testing a singly linked list implementation"
|
||||||
# Build an executable
|
LANGUAGES CXX
|
||||||
add_executable(SingleListDriver ${SRC})
|
)
|
||||||
|
|
||||||
|
add_executable(
|
||||||
|
data-singly-linked-list driver.cpp
|
||||||
|
singlelist.cpp singlelist.h
|
||||||
|
)
|
||||||
|
|
|
@ -1,17 +1,21 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example of a stack implementation using linked lists ##
|
## About: An example of a stack implementation using linked lists ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
## CMakeLists.txt
|
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
# Define the project name
|
project (
|
||||||
project(Stack)
|
#[[NAME]] Stack
|
||||||
# Define source files
|
VERSION 1.0
|
||||||
set(SRC driver.cpp stacklist.cpp)
|
DESCRIPTION "A project for testing a Stack implementation"
|
||||||
# Build an executable
|
LANGUAGES CXX
|
||||||
add_executable(StackDriver ${SRC})
|
)
|
||||||
|
|
||||||
|
add_executable(
|
||||||
|
data-stack driver.cpp
|
||||||
|
stacklist.cpp stacklist.h
|
||||||
|
)
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A root project for practicing templated data structures in C++ ##
|
## About: A root project for practicing templated data structures in C++ ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project (
|
project (
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example of a doubly linked list implementation ##
|
## About: An example of a templated doubly linked list implementation ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
# Define the project name
|
project (
|
||||||
project(DoubleList)
|
#[[NAME]] TemplatedDoubleList
|
||||||
# Define source files
|
VERSION 1.0
|
||||||
set(SRC driver.cpp)
|
DESCRIPTION "A project for practicing templated doubly linked list implementations"
|
||||||
# Build an executable
|
LANGUAGES CXX
|
||||||
add_executable(TemplatedDoubleListDriver ${SRC})
|
)
|
||||||
|
|
||||||
|
add_executable(data-templates-doubly-linked-list driver.cpp)
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example of a queue implementation ##
|
## About: An example of a templated queue implementation ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
# Define the project name
|
project (
|
||||||
project(Queue)
|
#[[NAME]] TemplatedQueue
|
||||||
# Define source files
|
VERSION 1.0
|
||||||
set(SRC driver.cpp)
|
DESCRIPTION "A project for practicing templated queue implementations"
|
||||||
# Build an executable
|
LANGUAGES CXX
|
||||||
add_executable(TemplatedQueueDriver ${SRC})
|
)
|
||||||
|
|
||||||
|
add_executable(data-templates-queue driver.cpp)
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: An example of a stack implementation using linked lists ##
|
## About: An example of a templated stack implementation using linked lists ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
# Define the project name
|
project (
|
||||||
project(Stack)
|
#[[NAME]] TemplatedStack
|
||||||
# Define source files
|
VERSION 1.0
|
||||||
set(SRC driver.cpp)
|
DESCRIPTION "A project for practicing templated Stack implementations"
|
||||||
# Build an executable
|
LANGUAGES CXX
|
||||||
add_executable(TemplatedStackDriver ${SRC})
|
)
|
||||||
|
|
||||||
|
add_executable(data-templates-stack driver.cpp)
|
||||||
|
|
|
@ -1,17 +1,18 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A basic CMakeLists configuration to test Vector implementation ##
|
## About: An example of a templated vector implementation ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
## vector.cpp
|
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
# Define the project name
|
project (
|
||||||
project(VectorDriver)
|
#[[NAME]] TemplatedVector
|
||||||
# Define source files
|
VERSION 1.0
|
||||||
set(SRC driver.cpp)
|
DESCRIPTION "A project for practicing templated Vector implementations"
|
||||||
# Build an executable
|
LANGUAGES CXX
|
||||||
add_executable(TemplatedVectorDriver ${SRC})
|
)
|
||||||
|
|
||||||
|
add_executable(data-templates-vectors driver.cpp)
|
||||||
|
|
|
@ -1,17 +1,21 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A basic CMakeLists configuration to test Vector implementation ##
|
## About: A basic CMakeLists configuration to test Vector implementation ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
## vector.cpp
|
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
# Define the project name
|
project (
|
||||||
project(VectorDriver)
|
#[[NAME]] VectorDriver
|
||||||
# Define source files
|
VERSION 1.0
|
||||||
set(SRC driver.cpp vector.cpp)
|
DESCRIPTION "A project for testing a basic Vector implementation"
|
||||||
# Build an executable
|
LANGUAGES CXX
|
||||||
add_executable(VectorDriver ${SRC})
|
)
|
||||||
|
|
||||||
|
add_executable(
|
||||||
|
data-vectors driver.cpp
|
||||||
|
vector.cpp vector.h
|
||||||
|
)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
||||||
## About: A root project for practicing C++ ##
|
## About: A root project for practicing C++ ##
|
||||||
|
@ -6,8 +6,8 @@
|
||||||
## Or, any subdirectory with a project() statement can be selected ##
|
## Or, any subdirectory with a project() statement can be selected ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project(
|
project(
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
|
|
||||||
# Define CMake version
|
# Define CMake version
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
@ -15,15 +14,15 @@ project(
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(lib-opengl-test "src/lib-opengl-test.cpp")
|
add_library(graphics-lib-opengl src/lib-opengl-test.cpp)
|
||||||
target_include_directories(lib-opengl-test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
target_include_directories(graphics-lib-opengl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
|
|
||||||
# Find OpenGL package
|
# Find OpenGL package
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
if (OPENGL_FOUND)
|
if (OPENGL_FOUND)
|
||||||
# Link opengl-test executable to OpenGL
|
# Link opengl-test executable to OpenGL
|
||||||
target_include_directories(lib-opengl-test PUBLIC ${OPENGL_INCLUDE_DIR})
|
target_include_directories(graphics-lib-opengl PUBLIC ${OPENGL_INCLUDE_DIR})
|
||||||
target_link_libraries(lib-opengl-test PUBLIC ${OPENGL_LIBRARIES})
|
target_link_libraries(graphics-lib-opengl PUBLIC ${OPENGL_LIBRARIES})
|
||||||
else()
|
else()
|
||||||
message(
|
message(
|
||||||
"Error: CMake was unable to find the OpenGL package\n"
|
"Error: CMake was unable to find the OpenGL package\n"
|
||||||
|
@ -35,8 +34,8 @@ endif()
|
||||||
find_package(GLUT REQUIRED)
|
find_package(GLUT REQUIRED)
|
||||||
if (GLUT_FOUND)
|
if (GLUT_FOUND)
|
||||||
# Link lib-opengl-test executable to GLUT
|
# Link lib-opengl-test executable to GLUT
|
||||||
target_include_directories(lib-opengl-test PUBLIC ${GLUT_INCLUDE_DIR})
|
target_include_directories(graphics-lib-opengl PUBLIC ${GLUT_INCLUDE_DIR})
|
||||||
target_link_libraries(lib-opengl-test PUBLIC ${GLUT_LIBRARIES})
|
target_link_libraries(graphics-lib-opengl PUBLIC ${GLUT_LIBRARIES})
|
||||||
else()
|
else()
|
||||||
message(
|
message(
|
||||||
"Error: CMake was unable to find the GLUT package\n"
|
"Error: CMake was unable to find the GLUT package\n"
|
||||||
|
@ -45,6 +44,6 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Add test executable
|
# Add test executable
|
||||||
add_executable(opengl-test "apps/test-gl.cpp")
|
add_executable(graphics-cmake-opengl apps/test-gl.cpp)
|
||||||
target_link_libraries(opengl-test PRIVATE lib-opengl-test)
|
target_link_libraries(graphics-cmake-opengl PRIVATE graphics-lib-opengl)
|
||||||
target_include_directories(opengl-test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
target_include_directories(graphics-cmake-opengl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
|
|
||||||
# Define CMake version
|
# Define CMake version
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
@ -17,15 +16,14 @@ project(
|
||||||
|
|
||||||
# Add Library
|
# Add Library
|
||||||
add_library(
|
add_library(
|
||||||
lib-sdl-test # Library Name
|
graphics-lib-sdl # Library Name
|
||||||
"src/lib-sdl-test.cpp" # Sources..
|
src/lib-sdl-test.cpp src/lib-sdl-test.h # Sources..
|
||||||
"src/lib-sdl-test.h"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories( # When calling library, include a directory
|
target_include_directories( # When calling library, include a directory
|
||||||
lib-sdl-test # Library name
|
graphics-lib-sdl # Library name
|
||||||
PUBLIC # Visibility
|
PUBLIC # Visibility
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/src" # Source directory for library
|
${CMAKE_CURRENT_SOURCE_DIR}/src # Source directory for library
|
||||||
)
|
)
|
||||||
|
|
||||||
# Search for SDL2 package
|
# Search for SDL2 package
|
||||||
|
@ -35,20 +33,20 @@ find_package(SDL2 REQUIRED sdl2)
|
||||||
if (SDL2_FOUND)
|
if (SDL2_FOUND)
|
||||||
# Any target that links with this library will also link to SDL2
|
# Any target that links with this library will also link to SDL2
|
||||||
# + Because we choose PUBLIC visibility
|
# + Because we choose PUBLIC visibility
|
||||||
target_include_directories(lib-sdl-test PUBLIC ${SDL2_INCLUDE_DIRS})
|
target_include_directories(graphics-lib-sdl PUBLIC ${SDL2_INCLUDE_DIRS})
|
||||||
target_link_libraries(lib-sdl-test PUBLIC "${SDL2_LIBRARIES}")
|
target_link_libraries(graphics-lib-sdl PUBLIC "${SDL2_LIBRARIES}")
|
||||||
|
|
||||||
# Creating executable
|
# Creating executable
|
||||||
add_executable(
|
add_executable(
|
||||||
sdl-test # Exe name
|
graphics-cmake-sdl # Exe name
|
||||||
"apps/sdl-test.cpp" # Exe Source(s)
|
apps/sdl-test.cpp # Exe Source(s)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Linking the exe to library
|
# Linking the exe to library
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
sdl-test # Executable to link
|
graphics-cmake-sdl # Executable to link
|
||||||
PRIVATE # Visibility
|
PRIVATE # Visibility
|
||||||
lib-sdl-test # Library to link
|
graphics-lib-sdl # Library to link
|
||||||
)
|
)
|
||||||
|
|
||||||
else()
|
else()
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A project for practicing C++ design patterns ##
|
## About: A project for practicing C++ design patterns ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project(
|
project(
|
||||||
|
|
|
@ -15,7 +15,8 @@ project(
|
||||||
)
|
)
|
||||||
add_compile_options("-Wall")
|
add_compile_options("-Wall")
|
||||||
|
|
||||||
add_library(abstract-parts "parts.cpp")
|
add_executable(
|
||||||
add_library(abstract-factory "factory.cpp")
|
patterns-abstract-factory main.cpp
|
||||||
add_executable(abstract-factory-test "main.cpp")
|
parts.cpp parts.hpp
|
||||||
target_link_libraries(abstract-factory-test abstract-factory abstract-parts)
|
abstract-factory.cpp abstract-factory.hpp
|
||||||
|
)
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A project for practicing the adapter C++ design pattern ##
|
## About: A project for practicing the adapter C++ design pattern ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project(
|
project(
|
||||||
#[[NAME]] Adapter
|
#[[NAME]] Adapter
|
||||||
VERSION 1.0
|
VERSION 1.0
|
||||||
|
@ -15,6 +16,7 @@ project(
|
||||||
)
|
)
|
||||||
add_compile_options("-Wall")
|
add_compile_options("-Wall")
|
||||||
|
|
||||||
add_library(adapter "adapter.cpp")
|
add_executable(
|
||||||
add_executable(adapter-test "main.cpp")
|
patterns-adapter main.cpp
|
||||||
target_link_libraries(adapter-test adapter)
|
adapter.cpp adapter.hpp
|
||||||
|
)
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A project for practicing the bridge C++ design pattern ##
|
## About: A project for practicing the bridge C++ design pattern ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project(
|
project(
|
||||||
#[[NAME]] Bridge
|
#[[NAME]] Bridge
|
||||||
VERSION 1.0
|
VERSION 1.0
|
||||||
|
@ -15,7 +16,8 @@ project(
|
||||||
)
|
)
|
||||||
add_compile_options("-Wall")
|
add_compile_options("-Wall")
|
||||||
|
|
||||||
add_library(abstraction "abstraction.cpp")
|
add_executable(
|
||||||
add_library(implementation "implementation.cpp")
|
patterns-bridge main.cpp
|
||||||
add_executable(bridge-test "main.cpp")
|
abstraction.cpp abstraction.hpp
|
||||||
target_link_libraries(bridge-test abstraction implementation)
|
implementation.cpp implementation.hpp
|
||||||
|
)
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A project for practicing the factory C++ design pattern ##
|
## About: A project for practicing the factory C++ design pattern ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project(
|
project(
|
||||||
#[[NAME]] Factory
|
#[[NAME]] Factory
|
||||||
VERSION 1.0
|
VERSION 1.0
|
||||||
|
@ -15,7 +16,8 @@ project(
|
||||||
)
|
)
|
||||||
add_compile_options("-Wall")
|
add_compile_options("-Wall")
|
||||||
|
|
||||||
add_library(parts "parts.cpp")
|
add_executable(
|
||||||
add_library(factory "factory.cpp")
|
patterns-factory main.cpp
|
||||||
add_executable(factory-test "main.cpp")
|
parts.cpp parts.hpp
|
||||||
target_link_libraries(factory-test factory parts)
|
factory.cpp abstract-factory.hpp
|
||||||
|
)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "factory.hpp"
|
#include "abstract-factory.hpp"
|
||||||
|
|
||||||
Part* GearFactory::requestPart() {
|
Part* GearFactory::requestPart() {
|
||||||
// Create a new part
|
// Create a new part
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "factory.hpp"
|
#include "abstract-factory.hpp"
|
||||||
|
|
||||||
int main(const int argc, const char * argv[]) {
|
int main(const int argc, const char * argv[]) {
|
||||||
// Testing GearFactory
|
// Testing GearFactory
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A project for practicing the observer C++ design pattern ##
|
## About: A project for practicing the observer C++ design pattern ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project(
|
project(
|
||||||
#[[NAME]] Observer
|
#[[NAME]] Observer
|
||||||
VERSION 1.0
|
VERSION 1.0
|
||||||
|
@ -15,6 +16,7 @@ project(
|
||||||
)
|
)
|
||||||
add_compile_options("-Wall")
|
add_compile_options("-Wall")
|
||||||
|
|
||||||
add_library(observer "observer.cpp")
|
add_executable(
|
||||||
add_executable(observer-test "main.cpp")
|
patterns-observer main.cpp
|
||||||
target_link_libraries(observer-test observer)
|
observer.cpp observer.hpp
|
||||||
|
)
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A project for practicing the prototype C++ design pattern ##
|
## About: A project for practicing the prototype C++ design pattern ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project(
|
project(
|
||||||
#[[NAME]] Prototype
|
#[[NAME]] Prototype
|
||||||
VERSION 1.0
|
VERSION 1.0
|
||||||
|
@ -15,6 +16,7 @@ project(
|
||||||
)
|
)
|
||||||
add_compile_options("-Wall")
|
add_compile_options("-Wall")
|
||||||
|
|
||||||
add_library(prototype "prototype.cpp")
|
add_executable(
|
||||||
add_executable(prototype-test "main.cpp")
|
patterns-prototype main.cpp
|
||||||
target_link_libraries(prototype-test prototype)
|
prototype.cpp prototype.hpp
|
||||||
|
)
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A project for practicing the singleton C++ design pattern ##
|
## About: A project for practicing the singleton C++ design pattern ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project(
|
project(
|
||||||
|
@ -15,7 +15,8 @@ project(
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(singleton "singleton.cpp")
|
add_executable(
|
||||||
add_library(singleton-pointer "singleton-pointer.cpp")
|
patterns-singleton main.cpp
|
||||||
add_executable(singleton-test "main.cpp")
|
singleton-pointer.cpp singleton-pointer.hpp
|
||||||
target_link_libraries(singleton-test singleton singleton-pointer)
|
singleton.cpp singleton.hpp
|
||||||
|
)
|
||||||
|
|
|
@ -19,7 +19,13 @@ private:
|
||||||
ClassicSingleton(){ message = "New ClassicSingleton\n";}
|
ClassicSingleton(){ message = "New ClassicSingleton\n";}
|
||||||
// Do not allow copying of this object
|
// Do not allow copying of this object
|
||||||
ClassicSingleton(const ClassicSingleton&){}
|
ClassicSingleton(const ClassicSingleton&){}
|
||||||
|
// Ignore -Wreturn-type warnings; It's intentional for this pattern
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wreturn-type"
|
||||||
ClassicSingleton& operator=(const ClassicSingleton&){}
|
ClassicSingleton& operator=(const ClassicSingleton&){}
|
||||||
|
// Unmatched pop reverts GCC to commandline options
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
// Static pointer to instance of this singleton
|
// Static pointer to instance of this singleton
|
||||||
static ClassicSingleton* instance;
|
static ClassicSingleton* instance;
|
||||||
|
|
|
@ -17,9 +17,15 @@ private:
|
||||||
std::string message;
|
std::string message;
|
||||||
|
|
||||||
// Don't allow copying of this class
|
// Don't allow copying of this class
|
||||||
|
// Ignore -Wreturn-type warnings; It's intentional for this pattern
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wreturn-type"
|
||||||
Singleton() { message = "New singleton\n";}
|
Singleton() { message = "New singleton\n";}
|
||||||
Singleton(const Singleton &) {}
|
Singleton(const Singleton &) {}
|
||||||
Singleton &operator=(const Singleton &) {}
|
Singleton &operator=(const Singleton &) {}
|
||||||
|
// Unmatched pop reverts GCC to commandline options
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SINGLETON_H
|
#endif // SINGLETON_H
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A project for practicing the state C++ design pattern ##
|
## About: A project for practicing the state C++ design pattern ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project(
|
project(
|
||||||
#[[NAME]] State
|
#[[NAME]] State
|
||||||
VERSION 1.0
|
VERSION 1.0
|
||||||
|
@ -15,6 +16,7 @@ project(
|
||||||
)
|
)
|
||||||
add_compile_options("-Wall")
|
add_compile_options("-Wall")
|
||||||
|
|
||||||
add_library(state "state.cpp")
|
add_executable(
|
||||||
add_executable(state-test "main.cpp")
|
patterns-state main.cpp
|
||||||
target_link_libraries(state-test state)
|
state.cpp state.hpp
|
||||||
|
)
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
###############################################################################
|
################################################################################
|
||||||
## Author: Shaun Reed ##
|
## Author: Shaun Reed ##
|
||||||
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||||
## About: A project for practicing the visitor C++ design pattern ##
|
## About: A project for practicing the visitor C++ design pattern ##
|
||||||
## ##
|
## ##
|
||||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||||
##############################################################################
|
################################################################################
|
||||||
#
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
project(
|
project(
|
||||||
#[[NAME]] Visitor
|
#[[NAME]] Visitor
|
||||||
VERSION 1.0
|
VERSION 1.0
|
||||||
|
@ -15,6 +16,7 @@ project(
|
||||||
)
|
)
|
||||||
add_compile_options("-Wall")
|
add_compile_options("-Wall")
|
||||||
|
|
||||||
add_library(visitor "visitor.cpp")
|
add_executable(
|
||||||
add_executable(visitor-test "main.cpp")
|
patterns-visitor main.cpp
|
||||||
target_link_libraries(visitor-test visitor)
|
visitor.cpp visitor.hpp
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in New Issue