Another approach to detect cycle in a single link list