In C, WITH NODES Nodes should contain a C-style string as the main data value • You should have the following files (nam

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

In C, WITH NODES Nodes should contain a C-style string as the main data value • You should have the following files (nam

Post by answerhappygod »

In C, WITH NODES
Nodes should contain a C-style string as the main data
value
• You should have the following files (named as follows):
• driver.c which is your driver file
• Node.h which contains your struct definition
• LinkedList.h which contains your header file for your linked list
implementation and contains
methods void printList(struct node *) and struct node*
makeList(void)
• LinkedList.c which contains your implementation for your linked
list class
• The user should be prompted with “Enter a word or phrase, or -99
to end: ”
• You should make sure to correctly allocate and deallocate
memory.
• Once -99 is entered, the program should state:
o You’ve entered the following nodes: word1, word2, word3, ..., and
wordx.
struct node {
char data;
struct node* next;
} *head;
Sample output:
Enter a word or phrase, or -99 to end: Hello World
Enter a word or phrase, or -99 to end: Goodbye World
Enter a word or phrase, or -99 to end: -99
You've entered the following nodes: Hello World and Goodbye
World
Enter a word or phrase, or -99 to end: Hello World
Enter a word or phrase, or -99 to end: Fridays
Enter a word or phrase, or -99 to end: are the best weekdays
Enter a word or phrase, or -99 to end: -99
You've entered the following nodes: Hello World, Fridays, and are
the best weekdays
Enter a word or phrase, or -99 to end: Hey!
Enter a word or phrase, or -99 to end: -99
You've entered the following nodes: Hey!
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply