Linkedlist with insertion and deleting
<pre><code>#include&lt;iostream&gt;
#include&lt;cstdlib&gt;
#include&lt;cstring&gt;
using namespace std;

const int MAX_WORD_LENGTH = 80;
struct Node;
typedef Node *Node_ptr;

struct Node
{
       char word[MAX_WORD_LENGTH];
       Node_ptr ptr_to_next_node;
       };

       void assign_list(Node_ptr &amp;a_list);

       void assign_new_node(Node_ptr &amp;a_node);

       void print_list(Node_ptr a_node);

       int main()
       {
           Node_ptr my_list = NULL;
           assign_list(my_list);
           cout&lt;&lt;"\nTHE LIST IS NOW:\n";
           print_list(my_list);

           system("pause");
           return 0;
           }
       void assign_list(Node_ptr &amp;a_list)
       {
            Node_ptr current_node,last_node;
            assign_new_node(a_list);
            cout&lt;&lt;"Enter first word (or '.' to end list):";
            cin&gt;&gt;a_list-&gt;word;
            if (!strcmp(".",a_list-&gt;word))
            {
            delete a_list;
            a_list=NULL;
            }
            current_node=a_list;
            while(current_node !=NULL)
            {
            assign_new_node(last_node);
            cout&lt;&lt;"Enter first word (or '.' to end list):";
            cin&gt;&gt;last_node-&gt;word;
            if (!strcmp(".",last_node-&gt;word))
            {
            delete last_node;
            last_node= NULL;
            }
            current_node-&gt;ptr_to_next_node=last_node;
            current_node=last_node;
            }
            }
            void assign_new_node(Node_ptr &amp;a_node)
            {
            a_node= new Node;
            if (a_node==NULL)
            {
            cout&lt;&lt;"sorry- no more memory\n";
            exit(1);
            }
            }
            void print_list(Node_ptr a_node)
            {
            cout&lt;&lt;a_node-&gt;word&lt;&lt;"";
            a_node=a_node-&gt;ptr_to_next_node;
            }
</code></pre>

<p>/<em>Modify the above program such that after the program displays the list it will asked the user to add another word specifying after which word will the added new word will be added. The program again will display the list and asked the user to delete a word. After the program deletes the word it will display the list once more and finally display the sorted list.</em>/    </p>
