implementation of one-way cycle linked list