اريد حل هذا الأسايمنت أذا ممكن
ولكم جزيل الشكر
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:
ahmed à salim à tamir àwalid
; 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.
ولكم جزيل الشكر
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:
ahmed à salim à tamir àwalid
; 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.
تعليق