No, sorry, you're wrong. A linked list is definitely NOT a LIFO structure. (LIFO means "Last In, First Out"). That's a Stack. You can implement a stack using a linked list, or array, or vector, etc... but one is definitely _NOT_ forced to follow this restriction on how items are inserted or removed from a linked list
The above code sample is also a really poor example of C++. The only thing that really makes it C++ is the use of cout.
Otherwise, it's a very C-ish implementation -- you don't use a Linked List or Linked List Node object, everything's declared as individual functions in global scope.
Also, notice that your pop() method doesn't delete nodes being removed from the list. You've got a blatantly obvious memory leak. You use "new" to create new list nodes, but don't use delete to free them.
A linked list is simply described as a data structure where each node in the list is "connected" to the node next to it in succession. You can also create a "doubly-linked" list, where each node is connected to the node before it as well. There is usually a node which serves the role of the "head" of the list. This means that insertions and deletions to the head of the list are fairly quick and operate in constant time.
This also means that searching for an item in the list or inserting at the back of the list is a relatively expensive operation, and occurs in linear time. (That is, the time it takes to perform the operation grows proportionally to the size of the list. "Size of the list" means the number of elements in the list.
Again, you're much better off searching for a Linked List tutorial on the net than using the above example for guidance.
I recommend searching for a well-rounded tutorial on Data Structures. This tutorial should cover data structures including Stack, Queue, Deque (Double-Ended Queue), Linked List, Hash Table, Binary Tree, Priority Queue, etc. It should definitely mention the time complexity of each operation (insert, delete, search) for each structure.
As a developer, you'll find yourself in situation where several data structures will definitely serve to solve a problem, but usually one or two stand out as being the "ideal" choice when you think about the way you're going to USE the structures.
Take care,
Nik
http://www.bigaction.org/