I recommend you think twice about simple copying of head and tail pointers to copy one list to another. This is called shallow copy and works okay in simple programs but it can quickly cause problems if you aren't aware of what is happening. In particular, under this scenario if either list is deleted then the other list is useless because there is now no longer any place in memory to point to.
I recommend doing hard copy within the copy constructor, copy function. That way each list has it's own memory, even if it contains the same information.
Don't try to copy an empty list. If the list to copy is empty, then return from the function/constructor.
Reputation Points: 718
Solved Threads: 373
Nearly a Posting Maven
Offline 2,253 posts
since Jul 2005