Is there anyone that can give me a simple example of a sorted linked list in c++?
I'm currently taking a CIS course on pointers and sorting lists and we have to make a sorted linked list using specific requirements which I would edit later.
I'm hoping someone could make a very simple sorted linked list with 3 sample un-ordered numbers so I can learn from it. I have a difficult problem learning how to do it straight from words, I need some kind of visual example, I learn it best this way.
The list has 3 nodes: the first, storing the data 1; the second, storing the data 2; and the last, storing the data 3.
Note that the box represents a node, inside the node is the data, and the arrow represents the pointer to the next node. The last node of list's next pointer will be null.