Posts Tagged ‘couples’

Mehta Tag: Congratulations Manoj!

January 27th, 2008

Despite my pseudo code skills = null, congrats on your awesome solution of the Gale-Shapley algorithm:

public class StableMarriage {

    public static void main(String args[]) {
        Terminal.startTranscript("transcript.txt");
        test();
        Terminal.stopTranscript();
    }
    public static Relation findMarriages(PersonList eligible) {
        Relation couples = new Relation();
        while (eligible != null) {
            Man m = (Man) eligible.person;
            Woman w = m.topPick();
            Terminal.println("" + m + " proposes to " + w);
            if (w.likes(m)) {
                Terminal.print("  she accepts ");
        }
        return couple;
    }
 
        Manoj = new Man("manoj");
 
        Gouri = new Woman("gouri");
        
        }
    }
  • Share/Bookmark