Question
HOMEWORK 8 Linked Lists, Stacks, and Queues 1. Explain the difference between appending and inserting a node. When is one preferred over the other? (10
HOMEWORK 8 Linked Lists, Stacks, and Queues 1. Explain the difference between appending and inserting a node. When is one preferred over the other? (10 points) 2. What are the two steps involved in deleting a node from a linked list? Why cant we just use the delete operator to remove the node from memory? (10 points) 3. What is the principal difference between stacks and queues? Included at some point in your answer should be the terms FIFO and LIFO (to wit, the meaning of those acronyms should be included, as well). (10 points)
4. Given a linked list with the following node and pointer initializations:struct Cnode { double value; struct Cnode* next; }; struct Cnode* first = NULL; Assume that the list contains the values 30.41, 47.49, 74.75, and 85.86. a. Pictorially indicate the linked list, assuming that, in the lists final state, first points to the first node. (10 points) b. Write the code to create a pointer to Cnode called thisNode which is to be initialized to point to whatever first points. (10 points)
c. Write the code to advance thisNode to point to the node containing 74.75. (10 points)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started