the logic is quite simple...if the last node points to the head node,then its a circular link list. eg:

struct node*checkcirlinklist(struct node*head)
{
struct node *p;
p=head;
...