forked from krahets/hello-algo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cpp codes cmake build method (krahets#419)
* feat(codes/cpp): Add cmake build method * feat(codes/cpp): Modify the cpp support version to c++17 * feat(codes/cpp): fix graph_adjacency_list.cpp cannot be compiled into an executable * style(codes/cpp): Adjust the code to enhance compatibility. * feat(codes/cpp): Change cpp version from 17 to 11.
- Loading branch information
Showing
12 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
project(hello_algo CXX) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
|
||
include_directories(./include) | ||
|
||
add_subdirectory(chapter_tree) | ||
add_subdirectory(chapter_stack_and_queue) | ||
add_subdirectory(chapter_sorting) | ||
add_subdirectory(chapter_searching) | ||
add_subdirectory(chapter_heap) | ||
add_subdirectory(chapter_graph) | ||
add_subdirectory(chapter_hashing) | ||
add_subdirectory(chapter_computational_complexity) | ||
add_subdirectory(chapter_array_and_linkedlist) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
add_executable(array array.cpp) | ||
add_executable(linked_list linked_list.cpp) | ||
add_executable(list my_list.cpp) | ||
add_executable(my_list my_list.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
add_executable(leetcode_two_sum leetcode_two_sum.cpp) | ||
add_executable(space_complexity space_complexity.cpp ) | ||
add_executable(time_complexity time_complexity.cpp) | ||
add_executable(worst_best_time_complexity worst_best_time_complexity.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
add_executable(graph_bfs graph_bfs.cpp) | ||
add_executable(graph_dfs graph_dfs.cpp) | ||
# add_executable(graph_adjacency_list graph_adjacency_list.cpp) | ||
add_executable(graph_adjacency_list_test graph_adjacency_list_test.cpp) | ||
add_executable(graph_adjacency_matrix graph_adjacency_matrix.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
add_executable(array_hash_map array_hash_map.cpp) | ||
add_executable(hash_map hash_map.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
add_executable(heap heap.cpp) | ||
add_executable(my_heap my_heap.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
add_executable(binary_search binary_search.cpp) | ||
add_executable(hashing_search hashing_search.cpp) | ||
add_executable(linear_search linear_search.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
add_executable(bubble_sort bubble_sort.cpp) | ||
add_executable(insertion_sort insertion_sort.cpp) | ||
add_executable(merge_sort merge_sort.cpp) | ||
add_executable(quick_sort quick_sort.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
add_executable(array_deque array_deque.cpp) | ||
add_executable(array_queue array_queue.cpp) | ||
add_executable(array_stack array_stack.cpp) | ||
add_executable(deque deque.cpp) | ||
add_executable(linkedlist_deque linkedlist_deque.cpp) | ||
add_executable(linkedlist_queue linkedlist_queue.cpp) | ||
add_executable(linkedlist_stack linkedlist_stack.cpp) | ||
add_executable(queue queue.cpp) | ||
add_executable(stack stack.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
add_executable(avl_tree avl_tree.cpp) | ||
add_executable(binary_search_tree binary_search_tree.cpp) | ||
add_executable(binary_tree binary_tree.cpp) | ||
add_executable(binary_tree_bfs binary_tree_bfs.cpp) | ||
add_executable(binary_tree_dfs binary_tree_dfs.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
add_executable(include | ||
include.hpp PrintUtil.hpp | ||
ListNode.hpp TreeNode.hpp | ||
Vertex.hpp) |