View CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.19) | |
project(foo) | |
add_executable(foo src/main.cpp) | |
set_target_properties(foo PROPERTIES | |
VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" | |
VS_DEBUGGER_COMMAND_ARGUMENTS "bar.txt") |
View quick-sort.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
using std::vector; | |
template<typename T> | |
void exchange(vector<T>& list, int i, int j) | |
{ | |
T temp = list[i]; | |
list[i] = list[j]; | |
list[j] = temp; |
View merge-sort.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
template<typename T> | |
void exchange(vector<T>& list, int i, int j) | |
{ | |
T temp = list[i]; | |
list[i] = list[j]; | |
list[j] = temp; | |
} |
View shell-sort.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename T> | |
void exchange(vector<T>& list, int i, int j) | |
{ | |
T temp = list[i]; | |
list[i] = list[j]; | |
list[j] = temp; | |
} | |
/** | |
* Part of the drawback of the insertion sort |
View insertion-sort.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
template<typename T> | |
void exchange(vector<T>& list, int i, int j) | |
{ | |
T temp = list[i]; | |
list[i] = list[j]; | |
list[j] = temp; | |
} |
View selection-sort.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename T> | |
void exchange(Vector<T>& list, int i, int j) | |
{ | |
T temp = list[i]; | |
list[i] = list[j]; | |
list[j] = temp; | |
} | |
/** | |
* In a typical selection sort (a simple, but inefficient |
View client.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include "unionfind.h" | |
int main(int argc, const char* argv[]) | |
{ | |
int node_count; | |
std::cin >> node_count; | |
std::cout << "Size: " << node_count << std::endl; |
View client.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include "queue.h" | |
int main() | |
{ | |
Queue<std::string> orders; | |
orders.enqueue("burger"); | |
orders.enqueue("fries"); |
View client.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include "stack.h" | |
int main() | |
{ | |
Stack<std::string> notes; | |
notes.push("Hey"); | |
notes.push("what's"); | |
notes.push("up."); |
View main.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "static.h" | |
#include "shared.h" | |
#include <iostream> | |
void local_hello() | |
{ | |
std::cout << "Hello local world!" << std::endl; | |
} | |
int main() |
NewerOlder