Content deleted Content added
Line 20:
'''function''' stableMatching {
Initialize all ''m'' <math>\in</math> M and ''w'' <math>\in</math> W to ''free''
'''while''' <math>\exists</math> ''free'' man ''m'' who still has a woman ''w'' to propose to {
''w'' = ''m''’s highest ranked such woman
'''if''' ''w'' is ''free''
(''m'', ''w'') become ''engaged''
'''else''' some pair (''m’'', ''w'') already exists
'''if''' ''w'' prefers ''m'' to ''m’''
(''m'', ''w'') become ''engaged''
''m’'' becomes ''free''
'''else'''
(''m’'', ''w'') remain ''engaged''
}
}
|