Skip to content

Commit b4fd521

Browse files
committed
Working on merge sort.
1 parent 463382c commit b4fd521

File tree

4 files changed

+1027
-0
lines changed

4 files changed

+1027
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ add_subdirectory(queue_linked_list)
77
add_subdirectory(hash_table)
88
add_subdirectory(binary_search_tree)
99
add_subdirectory(priority_queue)
10+
add_subdirectory(merge_sort)

merge_sort/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
project(merge_sort_proj)
3+
4+
add_definitions(-std=c++11)
5+
add_definitions(-Werror) # stop compile on warning
6+
7+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_DEBUG")
8+
9+
set(SOURCE_FILES main.cc)
10+
11+
add_executable(merge_sort ${SOURCE_FILES} ${HEADER_FILES})

merge_sort/main.cc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <iostream>
2+
3+
int main(int argc, char* argv[]) {
4+
5+
int num_count = 30;
6+
int numbers[] = {5432, 989, 7510, 3, 583, 8919, 542, 123, 597, 42,
7+
7506, 184, 2409, 187, 45, 824, 4, 2650, 9, 662,
8+
3928, 170, 5358, 395, 842, 7697, 110, 14, 99, 221};
9+
10+
for (int i = 0; i < num_count; ++i) {
11+
printf("%d, ", numbers[i]);
12+
}
13+
14+
return 0;
15+
}

0 commit comments

Comments
 (0)