Longest common prefix

is it possible to find a longest common prefix in a circular array;
like abcd is given
find longest common prefix in a circular array consisting azxbc-
longest common prefix found is abc.
is it possible to use graph here??

Why would you want to use a graph? If I understand the problem correctly, it can be solved using two-pointer method. Why make it complicated?