Question: This is the code for Gale - Shapley algorithm which handle cases where the number of men and women are unequal. for this input case
This is the code for GaleShapley algorithm which handle cases where the number of men and women are unequal.
for this input case
m w w w
m w w w
m w w w
m w w w
w m m m m
w m m m m
w m m m m
output not coming properly.
output came:
m w
m w
m w
expected output:
m w
m w
m w
please correct the logic of the algorithm.
Also provide psuedo code, time complexity and space complexity.
I want correct output for all test cases and here my code is failing so make sure it does not fail other test cases.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
