In this assignment you are asked to write a simple program which behaves as follows:
You need to build a singly linked list which is initially empty. Each node in the list will contain a pointer
to the next node. The element stored in the node is of type “String” and it represents a name or a word.
Your job is to allow the user to insert a new word into the list. However, you must insert the new word
in the correct position based on its alphabetical order. For example, if the list already contains the
following words:
; and the user wants to insert the name “bader”, then it must be inserted after “ahmed”. You can
assume that all names (or words) will be provided by the user in small letters. All you have to do is to
search for the correct position to insert the new word by conducting some comparisons. The program
must allow the user to print the existing list.
1- This assignment is to be done individually. Copying the whole or part of someone else’s code will
be considered cheating and will receive an academic penalty.
2- Write your name and student ID at the top of the submitted file.
3- Your work will be evaluated based on the following criteria:
a- The program compiles and runs without any problems
b- Correct implementation of creating the list, inserting a new node, and printing the list.
c- Overall style and comments. Your code should be easy to read and understand and it should
be well commented.
You need to build a singly linked list which is initially empty. Each node in the list will contain a pointer
to the next node. The element stored in the node is of type “String” and it represents a name or a word.
Your job is to allow the user to insert a new word into the list. However, you must insert the new word
in the correct position based on its alphabetical order. For example, if the list already contains the
following words:
; and the user wants to insert the name “bader”, then it must be inserted after “ahmed”. You can
assume that all names (or words) will be provided by the user in small letters. All you have to do is to
search for the correct position to insert the new word by conducting some comparisons. The program
must allow the user to print the existing list.
1- This assignment is to be done individually. Copying the whole or part of someone else’s code will
be considered cheating and will receive an academic penalty.
2- Write your name and student ID at the top of the submitted file.
3- Your work will be evaluated based on the following criteria:
a- The program compiles and runs without any problems
b- Correct implementation of creating the list, inserting a new node, and printing the list.
c- Overall style and comments. Your code should be easy to read and understand and it should
be well commented.