Question: Write pseudocode (for this Gale-Shapley algorithm) that is lower level than the one given, it should show how you are using data structures to store
Write pseudocode (for this Gale-Shapley algorithm) that is "lower level" than the one given, it should show how you are using data structures to store the matches and to check the preferences. Give time complexity of the Data structures used in your implementation.

Let W be the set of Women and M be the set of Men 2. 3. 4. 5. 6. 7. 8. Initially, all me M and we W are free While there is a man m who is free and hasn't proposed to every woman w: Choose a man m Let w be the highest-ranked woman in m's preference list to whom m has not yet proposed If w is free then (m, w) become engaged Else w is currently engaged to m' If w prefers m' to m then m remains free Else w prefers m to m (m, w) become engaged m' becomes free 9. 10. 11. 12. 13. 14. 15. End While Return the set S of engaged pairs
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
