Skip to content

Commit 0dfaac5

Browse files
committed
Merge branch 'develop'
2 parents b48f73c + 5401ada commit 0dfaac5

Some content is hidden

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

45 files changed

+105
-105
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This repository is an implementation of algorithms, data structures, and problem
1313
Each project is configured in specific environments, as described below:
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 / [Poetry](https://python-poetry.org/) / [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
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
1717
- 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
1818

1919
## Table of Contents
@@ -75,7 +75,7 @@ reversed(number_list) # return an iterator
7575
number_list.sort() # in-place
7676
sorted(number_list) # return a new list(copy)
7777
del(number_list[0]) # delete the first element
78-
del(number_list[0:2]) # removes the slice
78+
del(number_list[0:2]) # remove the slice
7979
bisect.bisect_left(number_list, 3), bisect.bisect_right(number_list, 3), bisect.bisect(number_list, 3)
8080
bisect.insort_left(number_list, 3), bisect.insort_right(number_list, 3), bisect.insort(number_list, 3)
8181
@@ -1167,7 +1167,7 @@ list.sort(Comparator.comparingInt(String::length));
11671167
| ----------- | :-----------------: | ------------------------------------------------------------------------------------ |
11681168
| **Best** | $O(n^2)$ | if the list is already sorted |
11691169
| **Worst** | $O(n^2)$ | when sorted in ascending order, if you want to sort in descending order (vice versa) |
1170-
| **Average** | $O(n^2)$ | |
1170+
| **Average** | $O(n^2)$ | when the input list is in jumbled order |
11711171

11721172
**Examples**
11731173

README_ko-KR.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
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 / [Poetry](https://python-poetry.org/) / [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
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
1717
- 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/src/array/advancing_through.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ auto AdvancingThrough::CanReachEnd(const std::vector<int>& max_advance_steps) ->
55
auto furthest_reach_so_far = 0;
66
const auto last_index = static_cast<int>(max_advance_steps.size()) - 1;
77

8-
for (auto i = 0; i <= furthest_reach_so_far && furthest_reach_so_far < last_index; ++i)
8+
for (int i = 0; i <= furthest_reach_so_far && furthest_reach_so_far < last_index; ++i)
99
{
1010
furthest_reach_so_far = std::max(furthest_reach_so_far, max_advance_steps[i] + i);
1111
}

cpp-algorithm/src/array/arbitrary_precision_integer.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ auto ArbitraryPrecision::PlusOne(std::vector<int> number_array) -> std::vector<i
66
{
77
++number_array.back();
88

9-
for (auto i = static_cast<int>(number_array.size()) - 1; i > 0 && number_array[i] == 10; --i)
9+
for (int i = static_cast<int>(number_array.size()) - 1; i > 0 && number_array[i] == 10; --i)
1010
{
1111
number_array[i] = 0;
1212
++number_array[i - 1];
@@ -28,13 +28,13 @@ auto ArbitraryPrecision::StringAddition(const std::string& number_string1, const
2828
const auto larger = size1 >= size2 ? size1 : size2;
2929
auto sum = std::vector<int>(larger);
3030

31-
for (auto i = size1 - 1; i >= 0; --i)
31+
for (int i = size1 - 1; i >= 0; --i)
3232
{
3333
sum[i] += number_string1.at(i) == '1' ? 1 : 0;
3434
}
3535

3636
auto carry = 0;
37-
for (auto i = size2 - 1; i >= 0; --i)
37+
for (int i = size2 - 1; i >= 0; --i)
3838
{
3939
sum[i] += carry;
4040
sum[i] += number_string2.at(i) == '1' ? 1 : 0;
@@ -65,9 +65,9 @@ auto ArbitraryPrecision::Multiply(std::vector<int>& number_array1, std::vector<i
6565
number_array2.front() = std::abs(number_array2.front());
6666

6767
std::vector<int> result(number_array1.size() + number_array2.size(), 0);
68-
for (auto i = static_cast<int>(number_array1.size()) - 1; i >= 0; --i)
68+
for (int i = static_cast<int>(number_array1.size()) - 1; i >= 0; --i)
6969
{
70-
for (auto j = static_cast<int>(number_array2.size()) - 1; j >= 0; --j)
70+
for (int j = static_cast<int>(number_array2.size()) - 1; j >= 0; --j)
7171
{
7272
result[i + j + 1] += number_array1[i] * number_array2[j];
7373
result[i + j] += result[i + j + 1] / 10;

cpp-algorithm/src/array/delete_element.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ auto DeleteElement::DeleteDuplicates(std::vector<int>& numbers) -> std::vector<i
1010
}
1111

1212
auto write_index = 1;
13-
for (auto i = 1; i < static_cast<int>(numbers.size()); ++i)
13+
for (int i = 1; i < static_cast<int>(numbers.size()); ++i)
1414
{
1515
if (numbers[write_index - 1] != numbers[i])
1616
{

cpp-algorithm/src/array/dutch_national_flag.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ auto DutchFlag::DutchFlagPartition1(const int pivot_index, std::vector<Color>& a
44
{
55
const auto pivot = arr[pivot_index];
66

7-
for (auto i = 0; i < static_cast<Color>(arr.size()); ++i)
7+
for (int i = 0; i < static_cast<Color>(arr.size()); ++i)
88
{
9-
for (auto j = i + 1; j < static_cast<Color>(arr.size()); ++j)
9+
for (int j = i + 1; j < static_cast<Color>(arr.size()); ++j)
1010
{
1111
if (arr[j] < pivot)
1212
{
@@ -15,9 +15,9 @@ auto DutchFlag::DutchFlagPartition1(const int pivot_index, std::vector<Color>& a
1515
}
1616
}
1717
}
18-
for (auto i = static_cast<Color>(arr.size()) - 1; i >= 0; --i)
18+
for (int i = static_cast<Color>(arr.size()) - 1; i >= 0; --i)
1919
{
20-
for (auto j = i - 1; j >= 0; --j)
20+
for (int j = i - 1; j >= 0; --j)
2121
{
2222
if (arr[j] > pivot)
2323
{
@@ -35,7 +35,7 @@ auto DutchFlag::DutchFlagPartition2(const int pivot_index, std::vector<Color>& a
3535
const auto pivot = arr[pivot_index];
3636

3737
auto smaller = 0;
38-
for (auto i = 0; i < static_cast<Color>(arr.size()); ++i)
38+
for (int i = 0; i < static_cast<Color>(arr.size()); ++i)
3939
{
4040
if (arr[i] < pivot)
4141
{
@@ -44,7 +44,7 @@ auto DutchFlag::DutchFlagPartition2(const int pivot_index, std::vector<Color>& a
4444
}
4545

4646
auto larger = static_cast<Color>(arr.size()) - 1;
47-
for (auto i = static_cast<Color>(arr.size()) - 1; i >= 0; --i)
47+
for (int i = static_cast<Color>(arr.size()) - 1; i >= 0; --i)
4848
{
4949
if (arr[i] > pivot)
5050
{

cpp-algorithm/src/array/enumerate_prime_number.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ auto EnumeratePrime::GeneratePrimes(int n) -> std::vector<int>
88
std::deque<bool> is_prime(n + 1, true);
99

1010
is_prime[0] = is_prime[1] = false;
11-
for (auto p = 2; p <= n; ++p)
11+
for (int p = 2; p <= n; ++p)
1212
{
1313
if (is_prime[p])
1414
{
1515
primes.push_back(p);
16-
for (auto i = p * 2; i <= n; i += p)
16+
for (int i = p * 2; i <= n; i += p)
1717
{
1818
is_prime[i] = false;
1919
}

cpp-algorithm/src/array/order_element.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void OrderElement::EvenOdd(std::vector<int>& arr)
2121

2222
auto OrderElement::Rearrange(std::vector<int>& numbers) -> std::vector<int>
2323
{
24-
for (auto i = 1; std::size(numbers); ++i)
24+
for (int i = 1; std::size(numbers); ++i)
2525
{
2626
if ((!(i % 2) && numbers[i - 1] < numbers[i]) || ((i % 2) && numbers[i - 1] > numbers[i]))
2727
{

cpp-algorithm/src/array/random_data_sampling.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
auto RandomDataSampling::OfflineRandomSampling(const int k, std::vector<int>& arr) -> std::vector<int>
77
{
88
std::default_random_engine seed((std::random_device())());
9-
for (auto i = 0; i < k; ++i)
9+
for (int i = 0; i < k; ++i)
1010
{
1111
std::uniform_int_distribution<int> dist(i, static_cast<int>(arr.size()) - 1);
1212
std::swap(arr[i], arr[dist(seed)]);

cpp-algorithm/src/array/replace_element.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ auto ReplaceElement::ReplaceAndRemoveString1(std::vector<std::string>& arr, cons
55
{
66
auto write_index = 0;
77
auto a_count = 0;
8-
for (auto i = 0; i < static_cast<int>(arr.size()); ++i)
8+
for (int i = 0; i < static_cast<int>(arr.size()); ++i)
99
{
1010
if (arr[i] != remove_str)
1111
{
@@ -41,7 +41,7 @@ auto ReplaceElement::ReplaceAndRemoveString2(std::vector<std::string>& arr, cons
4141
const std::string& remove_str) -> std::vector<std::string>
4242
{
4343
std::erase(arr, remove_str);
44-
for (auto i = 0; i < static_cast<int>(arr.size()); ++i)
44+
for (int i = 0; i < static_cast<int>(arr.size()); ++i)
4545
{
4646
if (arr[i] == replace_str)
4747
{
@@ -55,7 +55,7 @@ auto ReplaceElement::ReplaceAndRemoveString2(std::vector<std::string>& arr, cons
5555

5656
auto ReplaceElement::TelexEncoding(std::vector<std::string>& arr) -> std::vector<std::string>
5757
{
58-
for (auto i = 0; i < static_cast<int>(arr.size()); ++i)
58+
for (int i = 0; i < static_cast<int>(arr.size()); ++i)
5959
{
6060
if (arr[i] == ".")
6161
{

0 commit comments

Comments
 (0)