I am having a hard time understand the linkedlist (add,insert,delete) at first or at last. I attempted to search online and read books but I still dont get it. It's really confusing.
std::list is a linked list. But a linked list, in general, is simply a collection of nodes which hold some data and a pointer to the next node (and, in the case of a doubly linked list, a pointer to the previous node too). Inserting or removing a node is just a matter of deallocating memory and rearranging pointers. Wikipedia has a pretty good explanation: http://en.wikipedia.org/wiki/Linked_list