Implementation of Josephus problem using a basic Queue