IBM Interview Question

How you can determine if the given queue is circular queue or not?

Interview Answer

Anonymous

Nov 9, 2016

We will just take two pointers. one pointer will move one node at a time and another pointer will move two node at a time. We will just compare the address. If the address is same at any time the queue is circular else it is not.