User talk:Komal Masram

1   Notifications Privacy Shortcuts Account Settings

Suggested Pages See All Suggested Pages POPxo.com 26,282 people like this. •Neymar-FC Barcelona• 67,912 people like this. Manasa ladies tailoring institute 32,183 people like this. Sri Sri Radha Rasabihari Temple, ISKCON Juhu, Mumb... Sakshi likes this. Suggested Groups ye íßq ñhî æáßáñ {℅ããzâd^℅} 1 friend · 301 members Join Imran Rizwy's photo. Nagpur on my plate (NOMP) 14,941 members Join See All English (India) · Privacy · Terms · Cookies · Advertising · Ad Choices · More Facebook © 2015 News Feed Pooja Singh to ‎CodeChef 23 November 2014 ·

i need algorithm of this question

It is a walk-in-interview setup having an interview room with one chair and a waiting room with a number of chairs. The interviewer interviews candidates in the interview room. When the interviewer finishes interviewing a candidate, he dismisses the candidate and goes to the waiting room to see if there are other candidates waiting. If there are, he brings one of them to his room and interviews him. If there are no candidates waiting, he returns to his chair in the interview room and continues reading his last unfinished magazine. If there are no unfinished magazines, he starts reading a new magazine. After he finishes reading one full magazine, he goes to sleep. Each candidate, when he arrives, looks to see what the interviewer is doing. If the interviewer is reading a magazine, the candidate waits for the interviewer to finish reading the current page of the magazine. Then the candidate enters the interview room and asks the interviewer to interview him. If the interviewer is sleeping, the candidate wakes him up and then asks the interviewer to interview him. If the interviewer is interviewing another candidate, the candidate goes to the waiting room. If there is a free 3 chair in the waiting room, the candidate sits in it and waits his turn. If there is no free chair, then the candidate leaves. Based on a naive analysis, the above description should ensure that the walk-ininterview functions correctly, with the interviewer interviewing any candidate who arrives until there are no more candidates, and then reading magazines and/or sleeping until the next candidate arrives. In practice, there are a number of problems that can occur that are illustrative of general scheduling problems. Please discuss those problems and provide an algorithm to solve those problems. Note: There are two doors between the interview room and the waiting room. Tip: Read literature on the Dining Philosophers problem