Skip to content

Commit fe25cca

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents e10000f + ebcb4a0 commit fe25cca

File tree

132 files changed

+1970
-812
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+1970
-812
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: codejsha

.github/workflows/cmake.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: C++ CMake Build
2+
name: C++ CMake Test
33

44
on:
55
# push:
@@ -19,7 +19,11 @@ jobs:
1919
runs-on: ubuntu-latest
2020

2121
steps:
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
23+
24+
- name: Set variables
25+
run: |
26+
echo "BUILD_TYPE_LOWERCASE=$(echo ${BUILD_TYPE} | tr '[:upper:]' '[:lower:]')" >> ${GITHUB_ENV}
2327
2428
- name: Install dependencies
2529
run: |
@@ -38,12 +42,12 @@ jobs:
3842
run: ./vcpkg install gsl:x64-linux gtest:x64-linux benchmark:x64-linux fmt:x64-linux
3943

4044
- name: Configure CMake
41-
run: cmake --preset linux-release -S ${{github.workspace}}/cpp-algorithm -B ${{github.workspace}}/cpp-algorithm/out/build/linux-x64-release
45+
run: cmake --preset linux-${{env.BUILD_TYPE_LOWERCASE}} -S ${{github.workspace}}/cpp-algorithm -B ${{github.workspace}}/cpp-algorithm/out/build/linux-x64-${{env.BUILD_TYPE_LOWERCASE}}
4246

4347
- name: Build
44-
working-directory: ${{github.workspace}}/cpp-algorithm/out/build/linux-x64-release
48+
working-directory: ${{github.workspace}}/cpp-algorithm/out/build/linux-x64-${{env.BUILD_TYPE_LOWERCASE}}
4549
run: cmake --build . --config ${{env.BUILD_TYPE}} --target all --parallel 6
4650

4751
- name: Test
48-
working-directory: ${{github.workspace}}/cpp-algorithm/out/build/linux-x64-release
52+
working-directory: ${{github.workspace}}/cpp-algorithm/out/build/linux-x64-${{env.BUILD_TYPE_LOWERCASE}}
4953
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure

.github/workflows/gradle.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Java Gradle Build
2+
name: Java Gradle Test
33

44
on:
55
# push:
@@ -16,17 +16,17 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020

2121
- name: Setup JDK
22-
uses: actions/setup-java@v3
22+
uses: actions/setup-java@v4
2323
with:
2424
distribution: "zulu"
25-
java-version: "17"
25+
java-version: "21"
2626

2727
- name: Setup Gradle
28-
uses: gradle/gradle-build-action@v2
28+
uses: gradle/gradle-build-action@v3
2929

30-
- name: Build
30+
- name: Test
3131
working-directory: ${{github.workspace}}/java-algorithm
32-
run: gradle build
32+
run: gradle test

.github/workflows/python.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Python Build
2+
name: Python Poetry Test
33

44
on:
55
# push:
@@ -16,19 +16,20 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020

2121
- name: Setup Python
22-
uses: actions/setup-python@v3
22+
uses: actions/setup-python@v5
2323
with:
24-
python-version: "3.10"
24+
python-version: "3.11"
2525

2626
- name: Install dependencies
2727
working-directory: ${{github.workspace}}/python-algorithm
2828
run: |
2929
python -m pip install --upgrade pip
30-
pip install -r ./requirements.txt
30+
pip install poetry
31+
poetry install --with test
3132
3233
- name: Test
3334
working-directory: ${{github.workspace}}/python-algorithm
34-
run: pytest
35+
run: poetry run pytest

README.md

Lines changed: 267 additions & 154 deletions
Large diffs are not rendered by default.

README_ko-KR.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@
22

33
<!-- markdownlint-disable MD033 MD036 -->
44

5-
![C++ CMake Build](https://github.com/codejsha/algorithm-examples/actions/workflows/cmake.yml/badge.svg) ![Python Build](https://github.com/codejsha/algorithm-examples/actions/workflows/python.yml/badge.svg) ![Java Gradle Build](https://github.com/codejsha/algorithm-examples/actions/workflows/gradle.yml/badge.svg)
5+
![C++ CMake Test](https://github.com/codejsha/algorithm-examples/actions/workflows/cmake.yml/badge.svg) ![Python Poetry Test](https://github.com/codejsha/algorithm-examples/actions/workflows/python.yml/badge.svg) ![Java Gradle Test](https://github.com/codejsha/algorithm-examples/actions/workflows/gradle.yml/badge.svg)
66

77
[English](README.md) | [Korean](README_ko-KR.md)
88

9-
이 리포지토리는 알고리즘, 데이터 구조, 문제 해결에 대한 구현 예제입니다. 예제들은 C++, Python, Java로 작성되었으며, 각 언어는 다음과 같은 테스트 프레임워크를 사용합니다: [Google Test](https://google.github.io/googletest/)(C++), [pytest](https://docs.pytest.org/)(Python), [JUnit](https://junit.org/)(Java). 테스트를 실행하여 알고리즘 로직에 대한 메서드/함수를 수행합니다. 코드를 빌드하고 테스트하는 GitHub Actions 워크플로우는 수동으로 실행됩니다.
9+
이 리포지토리는 알고리즘, 데이터 구조, 문제 해결에 대한 구현 예제들로 구성되어 있습니다. 예제들은 C++, Python, Java로 작성되었으며, 각 언어는 다음과 같은 테스트 프레임워크를 사용합니다: [Google Test](https://google.github.io/googletest/)(C++), [pytest](https://docs.pytest.org/)(Python), [JUnit](https://junit.org/)(Java). 테스트를 실행하여 알고리즘 로직에 대한 메서드/함수를 수행합니다.
1010

1111
## Project Environments
1212

1313
각 프로젝트는 다음과 같은 환경에서 구성되었습니다:
1414

1515
- C++ project: C++20 / [CMake](https://cmake.org/) build / [GNU Scientific Library (GSL)](https://www.gnu.org/software/gsl/), [Google Test](https://google.github.io/googletest/), [Google Benchmark](https://github.com/google/benchmark), [fmt](https://github.com/fmtlib/fmt) packages / [vcpkg](https://github.com/microsoft/vcpkg) package manager
16-
- Python project: Python 3.11 / [NumPy](https://numpy.org/), [SciPy](https://www.scipy.org/), [pytest](https://docs.pytest.org/), [pytest-benchmark](https://pytest-benchmark.readthedocs.io/en/latest/) packages / [pip](https://pip.pypa.io/en/stable/) package manager
17-
- Java project: Java 17 / [Gradle](https://gradle.org/) build / [JUnit](https://junit.org/), [Java Microbenchmark Harness (JMH)](https://github.com/openjdk/jmh) libraries
18-
19-
<!-- markdownlint-enable MD033 MD036 -->
16+
- Python project: Python 3.11 / [Poetry](https://python-poetry.org/) build / [NumPy](https://numpy.org/), [SciPy](https://www.scipy.org/), [NetworkX](https://networkx.org/), [pytest](https://docs.pytest.org/), [pytest-benchmark](https://pytest-benchmark.readthedocs.io/en/latest/) packages
17+
- Java project: Java 21 / [Gradle](https://gradle.org/) build / [Guava](https://github.com/google/guava), [JUnit](https://junit.org/), [Java Microbenchmark Harness (JMH)](https://github.com/openjdk/jmh) libraries

cpp-algorithm/.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,4 @@ WhitespaceSensitiveMacros:
222222
- PP_STRINGIZE
223223
- STRINGIZE
224224
...
225+

cpp-algorithm/.editorconfig

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
# Visual Studio generated .editorconfig file with C++ settings.
1+
# EditorConfig file with C++ settings
2+
23
root = true
34

45
[*.{c++,cc,cpp,cppm,cxx,h,h++,hh,hpp,hxx,inl,ipp,ixx,tlh,tli}]
5-
6-
# Visual C++ Code Style settings
7-
86
cpp_generate_documentation_comments = doxygen_slash_star
9-
10-
# Visual C++ Formatting settings
11-
127
cpp_indent_braces = false
138
cpp_indent_multi_line_relative_to = innermost_parenthesis
149
cpp_indent_within_parentheses = indent

cpp-algorithm/.gitignore

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,13 @@ fabric.properties
125125
.idea/caches/build_file_checksums.ser
126126

127127
### Others
128-
/.idea/
129-
/.vs/
130-
/.vscode/
131-
/out/
132-
/cmake-build-debug/
133-
/cmake-build-debug-visual-studio/
134-
/cmake-build-release/
135-
/cmake-build-release-visual-studio/
136-
/Folder.DotSettings.user
128+
.idea/
129+
.vs/
130+
.vscode/
131+
out/
132+
cmake-build-debug/
133+
cmake-build-debug-visual-studio/
134+
cmake-build-release/
135+
cmake-build-release-visual-studio/
136+
Folder.DotSettings.user
137+
README_link.md

cpp-algorithm/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
cmake_minimum_required(VERSION 3.25)
22

33
project(
4-
cpp_algorithm
5-
VERSION 1.0
6-
DESCRIPTION
4+
cpp_algorithm
5+
VERSION 1.0
6+
DESCRIPTION
77
"Algorithm examples for C++"
8-
LANGUAGES CXX
8+
LANGUAGES CXX
99
)
1010

1111
set(CMAKE_CXX_STANDARD 20)
1212
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1313
set(CMAKE_CXX_EXTENSIONS OFF)
1414

15+
enable_testing()
1516
add_subdirectory(src)

0 commit comments

Comments
 (0)