Skip to content

Commit f9fcb73

Browse files
committed
fix: fixed nameing of namespace
1 parent a689963 commit f9fcb73

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

greedy_algorithms/gale_shapley.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/**
22
* @file
3-
* @brief [Gale Shapley](https://en.wikipedia.org/wiki/Gale%E2%80%93Shapley_algorithm)
3+
* @brief [Gale Shapley Algorithm](https://en.wikipedia.org/wiki/Gale%E2%80%93Shapley_algorithm)
44
* @details
55
* This implementation utilizes the Gale-Shapley algorithm to find stable matches
66
*
7-
* **Gale Shapley** aims to find a stable matching between two equally sized
7+
* **Gale Shapley Algorithm** aims to find a stable matching between two equally sized
88
* sets of elements given an ordinal preference for each element. The algorithm was
99
* introduced by David Gale and Lloyd Shapley in 1962.
1010
*
1111
* Reference:
1212
* [Wikipedia](https://en.wikipedia.org/wiki/Gale%E2%80%93Shapley_algorithm)
13-
* [Wikipedia](https://en.wikipedia.org/wiki/Stable_marriage_problem)
13+
* [Wikipedia](https://en.wikipedia.org/wiki/Stable_matching_problem)
1414
*
1515
* @author [B Karthik](https://github.com/BKarthik7)
1616
*/
@@ -27,9 +27,9 @@
2727
namespace greedy_algorithms {
2828
/**
2929
* @namespace
30-
* @brief Functions for the [Gale Shapley](https://en.wikipedia.org/wiki/Gale%E2%80%93Shapley_algorithm) algorithm
30+
* @brief Functions for the Gale Shapley Algorithm
3131
*/
32-
namespace stable_marriage {
32+
namespace stable_matching {
3333
void gale_shapley(const std::vector<std::vector<int>>& set_2_prefs, const std::vector<std::vector<int>>& set_1_prefs) {
3434
int n = set_2_prefs.size();
3535
std::vector<int> engagements(n, -1);
@@ -66,7 +66,7 @@ void gale_shapley(const std::vector<std::vector<int>>& set_2_prefs, const std::v
6666
}
6767
std::cout << std::endl;
6868
}
69-
} // namespace stable_marriage
69+
} // namespace stable_matching
7070
} // namespace greedy_algorithms
7171

7272
/**
@@ -78,17 +78,17 @@ static void tests() {
7878
// Test Case 1
7979
std::vector<std::vector<int>> set_1_prefs = {{0, 1, 2, 3}, {2, 1, 3, 0}, {1, 2, 0, 3}, {3, 0, 1, 2}};
8080
std::vector<std::vector<int>> set_2_prefs = {{1, 0, 2, 3},{3, 0, 1, 2},{0, 2, 1, 3},{1, 2, 0, 3}};
81-
greedy_algorithms::stable_marriage::gale_shapley(set_2_prefs, set_1_prefs);
81+
greedy_algorithms::stable_matching::gale_shapley(set_2_prefs, set_1_prefs);
8282

8383
// Test Case 2
8484
set_1_prefs = {{0, 2, 1, 3}, {2, 3, 0, 1}, {3, 1, 2, 0}, {2, 1, 0, 3}};
8585
set_2_prefs = {{1, 0, 2, 3},{3, 0, 1, 2},{0, 2, 1, 3},{1, 2, 0, 3}};
86-
greedy_algorithms::stable_marriage::gale_shapley(set_2_prefs, set_1_prefs);
86+
greedy_algorithms::stable_matching::gale_shapley(set_2_prefs, set_1_prefs);
8787

8888
// Test Case 3
8989
set_1_prefs = {{0, 1, 2}, {2, 1, 0}, {1, 2, 0}};
9090
set_2_prefs = {{1, 0, 2},{2, 0, 1},{0, 2, 1}};
91-
greedy_algorithms::stable_marriage::gale_shapley(set_2_prefs, set_1_prefs);
91+
greedy_algorithms::stable_matching::gale_shapley(set_2_prefs, set_1_prefs);
9292
}
9393

9494
/**

0 commit comments

Comments
 (0)