algorithm for movie ticket booking
Answers
Answered by
0
Answer:
Print all seats
Seed 20 random taken seats
Print all empty seats
Print all taken seats
I think my algorithm for generate 20 random taken seats doesn't look that efficient. I thought of extra space, which is the taken list. For that, while generated empty seats not equal with required empty seats, I will remove the random seat and push that random seat to taken list. But the problem with this is to print all the complete 30 seats, I have merge taken and empty list.
hope this helps...
Similar questions