Consider: struct Node { char data;
our data are characters Node *next; // pointer to the next node Node *prev
pointer to the previous node Node(const char& item, Node* next_ptr = NULL, Node* prev_ptr = NULL) : data(item), next(next_ptr), prev(prev_ptr) {} }; The node is a node in a doubly linked (but not circular) list in which the characters are stored in increasing alphabetical order. An object of the class List has as private data member: Node *first; // pointer to the first node in the list and we want to define the following method: void insert(char item)
Inserts the item so the list remains sorted. // If the item already exists in the list,
then it is inserted before the existing item. Give code for this insert method.
Illustrate the logic of your code with a drawing of at least 3 elements.