Speed dating algorithm

后端 未结 9 625
深忆病人
深忆病人 2021-02-04 10:19

I work in a consulting organization and am most of the time at customer locations. Because of that I rarely meet my colleagues. To get to know each other better we are going to

9条回答
  •  南笙
    南笙 (楼主)
    2021-02-04 10:43

    Why not imitate real world?

    class Person { 
        void doPeriodically() {
             do {
                 newTable = random (numberOfTables);
             } while (tableBusy(newTable))
             switchTable (newTable) 
        }
    }
    

    Oh, and note that there is a similar algorithm for finding a mating partner and it's rumored to be effective for those 99% of people who don't spend all of their free time answering programming questions...

提交回复
热议问题