Hello everyone, I have this working program with operations on circular doubly linked list. But I have one slight problem, for example when there is only one node in the list and when I try to remove it with my remove function, afterwards instead of printing that the list is now empty, it prints me garbage like 41096232 or crashes, why is that?
Your delete method doesn't reset the pointers to null, which is your invariant state for empty. So the object doen't know when it's empty.
You can improve the usability of your list my making start and last members of the class. That way you can instantiate many different instances of lists.
The methods should just take the values or positions to be processed. They shouldn't prompt the user. That will allow more flexible use.