Description
You may find it convenient if these operations take place one link downstream of the link pointed to by current. (Because the list is a singly linked list, you can’t get the upstream link without going all the way around the circle.) You should also be able to display the list. A step() method that moves current along to the next link might come in handy too. Write a driver class to test the circular list.
Hint:
a) The data members of class circular linked list should include the reference current and a variable to track the size of links in the circular list.
b) The methods needed to define in the class circular include:
insert: insert after current link delete:
delete one beyond current .
find: find link with given key e
deleteKey: delete link with given key
displayList: display the list (all the links in the list)
step: move current to the next link
peek: return the data stored in current .
isEmpty: check whether the list is empty
2. Implement a stack class based on the circular list created in the previous question. Write a driver class to test the circular list based stack.