Skip to content

Commit 272e366

Browse files
committed
TestCase Empty vector
1 parent ca6586d commit 272e366

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

greedy_algorithms/gale_shapley.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ static void tests() {
100100
primary_preferences = {{0, 1, 2}, {2, 1, 0}, {1, 2, 0}};
101101
secondary_preferences = {{1, 0, 2}, {2, 0, 1}, {0, 2, 1}};
102102
assert(greedy_algorithms::stable_matching::gale_shapley(secondary_preferences, primary_preferences) == std::vector<int>({0, 2, 1}));
103+
104+
// Test Case 4
105+
primary_preferences = {};
106+
secondary_preferences = {};
107+
assert(greedy_algorithms::stable_matching::gale_shapley(secondary_preferences, primary_preferences) == std::vector<int>({}));
103108
}
104109

105110
/**

0 commit comments

Comments
 (0)