circular array implementation
circular array implementation