-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
316 additions
and
1,081 deletions.
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
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
6 changes: 4 additions & 2 deletions
6
src/main/resources/templates/c_plus_plus/exercise/.clang-format
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
--- | ||
Language: Cpp | ||
Language: Cpp | ||
BasedOnStyle: Google | ||
IndentWidth: 4 | ||
ColumnLimit: 120 | ||
PointerAlignment: Left | ||
DerivePointerAlignment: false | ||
DerivePointerAlignment: false | ||
IncludeBlocks: Preserve |
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
3 changes: 0 additions & 3 deletions
3
src/main/resources/templates/c_plus_plus/exercise/include/ast-polymorphic.hpp
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
src/main/resources/templates/c_plus_plus/exercise/include/ast-template.hpp
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
src/main/resources/templates/c_plus_plus/exercise/include/linked-list-iterator.hpp
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
src/main/resources/templates/c_plus_plus/exercise/include/sort.hpp
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,19 @@ | ||
#pragma once | ||
|
||
#include <vector> | ||
|
||
void selection_sort(std::vector<int>::iterator begin, std::vector<int>::iterator end); | ||
|
||
void insertion_sort(std::vector<int>::iterator begin, std::vector<int>::iterator end); | ||
|
||
void quicksort(std::vector<int>::iterator begin, std::vector<int>::iterator end); | ||
|
||
void mergesort(std::vector<int>::iterator begin, std::vector<int>::iterator end); | ||
|
||
void mergesort_inplace(std::vector<int>::iterator begin, std::vector<int>::iterator end); | ||
|
||
void heapsort(std::vector<int>::iterator begin, std::vector<int>::iterator end); | ||
|
||
void heapsort_explicit(std::vector<int>::iterator begin, std::vector<int>::iterator end); | ||
|
||
void bogosort(std::vector<int>::iterator begin, std::vector<int>::iterator end); |
2 changes: 2 additions & 0 deletions
2
src/main/resources/templates/c_plus_plus/exercise/src/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#include "sort.hpp" | ||
|
||
int main() { | ||
// Test your implementation here | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/resources/templates/c_plus_plus/exercise/src/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,35 @@ | ||
#include "sort.hpp" | ||
|
||
#include <stdexcept> | ||
|
||
void selection_sort(std::vector<int>::iterator begin, std::vector<int>::iterator end) { | ||
throw std::logic_error("not implemented"); | ||
} | ||
|
||
void insertion_sort(std::vector<int>::iterator begin, std::vector<int>::iterator end) { | ||
throw std::logic_error("not implemented"); | ||
} | ||
|
||
void quicksort(std::vector<int>::iterator begin, std::vector<int>::iterator end) { | ||
throw std::logic_error("not implemented"); | ||
} | ||
|
||
void mergesort(std::vector<int>::iterator begin, std::vector<int>::iterator end) { | ||
throw std::logic_error("not implemented"); | ||
} | ||
|
||
void mergesort_inplace(std::vector<int>::iterator begin, std::vector<int>::iterator end) { | ||
throw std::logic_error("not implemented"); | ||
} | ||
|
||
void heapsort(std::vector<int>::iterator begin, std::vector<int>::iterator end) { | ||
throw std::logic_error("not implemented"); | ||
} | ||
|
||
void heapsort_explicit(std::vector<int>::iterator begin, std::vector<int>::iterator end) { | ||
throw std::logic_error("not implemented"); | ||
} | ||
|
||
void bogosort(std::vector<int>::iterator begin, std::vector<int>::iterator end) { | ||
throw std::logic_error("not implemented"); | ||
} |
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 |
---|---|---|
@@ -1,17 +1,15 @@ | ||
[task][CMake runs correctly](TestConfigure) | ||
1. [task][CMake runs correctly](TestConfigure) | ||
2. [task][Your code compiles](CompileSort) | ||
3. [task][Code is formatted with clang-format](clang-format(sort.cpp)) | ||
|
||
# Templated doubly linked list | ||
1. [task][Your code compiles](CompileLinkedList) | ||
2. [task][Tests are passing](TestCatch2(linked-list-iterator-test)) | ||
3. [task][Code is formatted with clang-format](clang-format(linked-list-iterator.hpp)) | ||
|
||
# AST with polymorphism | ||
1. [task][Your code compiles](CompileASTPolymorphic) | ||
2. [task][Tests are passing](TestCatch2(ast-polymorphic-test)) | ||
3. [task][Code is formatted with clang-format](clang-format(ast-polymorphic.hpp)) | ||
|
||
# AST with templates | ||
1. [task][Your code compiles](CompileASTTemplate) | ||
2. [task][Tests are passing](TestCatch2(ast-template-test)) | ||
3. [task][Code is formatted with clang-format](clang-format(ast-template.hpp)) | ||
4. Optional: [task][Tests for simplify are passing](TestCatch2(ast-template-simplify-test)) | ||
# Sorting Algorithms | ||
[task][All algorithms sort correctly](TestCatch2(sort-test)) | ||
1. [task][Selection Sort](sorting_algorithms/selection_sort,sorting_algorithms/all_elements_equal/selection_sort,sorting_algorithms/reverse-sorted_values/selection_sort,sorting_algorithms/single_values/selection_sort,sorting_algorithms/empty_input/selection_sort,sorting_algorithms/large_input/selection_sort) | ||
2. [task][Insertion Sort](sorting_algorithms/insertion_sort,sorting_algorithms/all_elements_equal/insertion_sort,sorting_algorithms/reverse-sorted_values/insertion_sort,sorting_algorithms/single_values/insertion_sort,sorting_algorithms/empty_input/insertion_sort,sorting_algorithms/large_input/insertion_sort) | ||
3. [task][Quicksort](sorting_algorithms/quicksort,sorting_algorithms/all_elements_equal/quicksort,sorting_algorithms/reverse-sorted_values/quicksort,sorting_algorithms/single_values/quicksort,sorting_algorithms/empty_input/quicksort,sorting_algorithms/large_input/quicksort) | ||
4. [task][Mergesort](sorting_algorithms/mergesort,sorting_algorithms/all_elements_equal/mergesort,sorting_algorithms/reverse-sorted_values/mergesort,sorting_algorithms/single_values/mergesort,sorting_algorithms/empty_input/mergesort,sorting_algorithms/large_input/mergesort) | ||
5. [task][Mergesort Inplace](sorting_algorithms/mergesort_inplace,sorting_algorithms/all_elements_equal/mergesort_inplace,sorting_algorithms/reverse-sorted_values/mergesort_inplace,sorting_algorithms/single_values/mergesort_inplace,sorting_algorithms/empty_input/mergesort_inplace,sorting_algorithms/large_input/mergesort_inplace) | ||
6. [task][Heapsort](sorting_algorithms/heapsort,sorting_algorithms/all_elements_equal/heapsort,sorting_algorithms/reverse-sorted_values/heapsort,sorting_algorithms/single_values/heapsort,sorting_algorithms/empty_input/heapsort,sorting_algorithms/large_input/heapsort) | ||
7. [task][Explicit Heapsort](sorting_algorithms/heapsort_explicit,sorting_algorithms/all_elements_equal/heapsort_explicit,sorting_algorithms/reverse-sorted_values/heapsort_explicit,sorting_algorithms/single_values/heapsort_explicit,sorting_algorithms/empty_input/heapsort_explicit,sorting_algorithms/large_input/heapsort_explicit) | ||
8. [task][Bogosort](bogosort,bogosort/empty_input,bogosort/single_value) |
6 changes: 4 additions & 2 deletions
6
src/main/resources/templates/c_plus_plus/solution/.clang-format
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
--- | ||
Language: Cpp | ||
Language: Cpp | ||
BasedOnStyle: Google | ||
IndentWidth: 4 | ||
ColumnLimit: 120 | ||
PointerAlignment: Left | ||
DerivePointerAlignment: false | ||
DerivePointerAlignment: false | ||
IncludeBlocks: Preserve |
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
Oops, something went wrong.