Guys, this might be kind of a silly questions but I would like a concrete answer on this so I will ask anyways.
Are there 4 cases in inserting and removing a node?
1.) inserting the first node if the list is empty
2.) inserting a node at the beginning of the list
3.) inserting a node in the middle of the list
4.) inserting a node at the end of the list
(same concept for removing)
I ask because my remove and insert functions look almost identical (with the exception of deleting the node) and if there are less cases then I can shorten up my code.
Well in the case that you're reading numbers or words from a file and putting them in numerical/alphabetical order then these would be the four separate cases, right?