Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Write a C-program called llereate.c that creates a linked list of integers from user input. Your program should use the following functions: - vaid freeLl(NodeT

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Write a C-program called llereate.c that creates a linked list of integers from user input. Your program should use the following functions: - vaid freeLl(NodeT "list): taken from the lecture. - void showLL(Node T " "ist): taken from the lecture but needs modification. - NodeT "joinLL(NodeT "ist, int v): returns a pointer to the linked list obtained by appending a new element with data v at the end of list. Needs to be implemented. The program - starts with an empty linked list called a11 (say), initialised to NULL - prompts the user with the message "Enter an integer:" - appends at the end of a11 a new linked list node created from user's response - asks for more user input and repeats the cycle - the cycle is terminated when the user enters any non-numeric character " on termination, the program generates the message "Done. List is" followed by the contents of the linked list in the format shown below A sample interaction is: prompts //11 create Enter an integer: 12 Enter an integer: 34 Enter an integer: 56 Enter an integer: quit Done. List is 12>34>56 Note that any non-numeric data 'finishes' the interaction. If the user provides no data, then no list should be output: prompts./11create Enter an integer: Done. 2. (Dynamic linked lists) Extend the C-program from the previous exercise to spit the linked list in two halves and output the result If the list has an odd number of elements, then the first I Note that - your algorithm should be 'in-place' (so you are not permitted to create a second linked list or use some other data structure such as an array); - you should not traverse the list more than once (e.g to count the number of elements and then restart from the beginning) An example of the program executing could be prompt $/11 split Enter an integer: 421 Enter an integer: 456732 Enter an integer: 321 Enter an integer: 4 Enter an integer: 86 Enter an integer: 89342 Enter an integer: 9 Enter an integer: 4 Done. List is 421>456732>321>4>86>89342>9 First part is 421>456732>321>4 Second part is 86>89342>9

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

More Books

Students explore these related Databases questions

Question

=+With whom does the firm have to negotiate?

Answered: 3 weeks ago

Question

=+Are there shop stewards?

Answered: 3 weeks ago