Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Function 1 - void printListReverse ( Node * head ) Create a function which displays a single linked list in reverser order. It is important

Function1- void printListReverse(Node *head)
Create a function which displays a single linked list in reverser order. It is important to understand
that l'm not asking you to reverse the nodes of the single linked list. I'm only asking you to print
the data values in reverse order.
E.i, if the list is 1234>5 NULL
You function should print "54321 NULL"
Function2- void reverseLinkedlist(&head)
Create a function to reverse the nodes of a single linked list. Call the function printList(Node
*head) to display the list in reverse order.
E.i, if the list is 12345 NULL
After creating and calling your function, printList() will display 54321NULL
Function3- findMiddleNode(Node *head)
Find and return the middle node for a LinkedList with an odd number of nodes. If the LinkedList is
even, return the highest of the two middle nodes.
Testcase:
List1: 1,2,3,4,5
Output: "middle noes is 3?
List1: 21,44,32,45,5,25
Output: " middle noes is 45'
List1: 3,94,37,4,45,58
Output: " middle noes is 37"
Function4- deleteMiddleNode(Node *head)
Find and delete the middle node of a Linkedlist. Use the printList() function to print the list after
removing middle node.
Testcase:
List1: 1,2,3,4,5
Output: 1245 NULL
List1: 21,44,32,45,5,25
Output: 21->44->32->5->25->NULL
List1: 3,94,37,4,45,58
Output: 39444558 NULL
Write in C and show code please
image text in transcribed

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

Step: 3

blur-text-image

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

AWS Certified Database Study Guide Specialty DBS-C01 Exam

Authors: Matheus Arrais, Rene Martinez Bravet, Leonardo Ciccone, Angie Nobre Cocharero, Erika Kurauchi, Hugo Rozestraten

1st Edition

1119778956, 978-1119778950

More Books

Students also viewed these Databases questions

Question

=+ (b) Define a set function v, on , by (11.6) "o (f, g] = A(g-f).

Answered: 1 week ago