Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement a new function in dlinkedlist.c that builds a Dlist from user input, using the existing functions getint and addToEnd. /I Prompt the user for

image text in transcribed
Implement a new function in dlinkedlist.c that builds a Dlist from user input, using the existing functions getint and addToEnd. /I Prompt the user for a sequence of integers and build the // corresponding doubly-linked list. End the sequence with -1. Node buildDlist) // TODO Implement the following four functions in dlinkedlist.c .int findLargest (Node start) .int findSmallest (Node start) . void printBackward (Node start) . void swapNodes (Node start, int a, int b) At the bottom of dlinkedlist.c, add a main function that tests your code. For example, use buildDlist to make the doubly-linked list: 01020304050NULL. The run several tests on your new functions, like this: int main) Node h buildDlist printf("Forward: " print(h); printf ("Largest : "); int large-findLargest(h); printf("%d ", large); printf("Smallest:; int small findSmallest(h); printf("xd In", small); printf( "Backward: " printBackward(h); printf("Swap 10 40: "); swapNodes (h, 10, 40); print(h); printf("Swap 10 40: "); swapNodes (h, 1, 40); print(h); printf("Swap 10 5e: "); swapNodes (h, 1, 50); print(h); printf("Swap 20 30: "); swapNodes (h, 20, 30) print(h); printf("Swap 20 3:"); swapNodes (h, 20, 30) print(h)

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

Logistics Lifeline Supply Chain Strategies

Authors: Ehsan Sheroy

1st Edition

7419377502, 978-7419377503

More Books

Students also viewed these Databases questions

Question

Does it avoid using personal pronouns (such as I and me)?

Answered: 1 week ago

Question

=+48-4 Trace the onset and development of children's self-concepts.

Answered: 1 week ago

Question

b. Why were these values considered important?

Answered: 1 week ago