Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

***Using C++ and also please label a and c accordingly. Thank you!!**** a) Write the member function void deleteNode() that will delete the first node

image text in transcribed

***Using C++ and also please label "a" and "c" accordingly. Thank you!!****

a) Write the member function void deleteNode() that will delete the first node from the linked list.

b) Modify the LList to create a data member Node *cur that points to the current node. Write the following member functions:

void forward() that moves the cur pointer to the next node.

void backward() that moves the cur pointer to the previous node.

void delete() that removes the node that is pointed to by the cur pointer. ( Think of how you will set the cur pointer after the delete and state your strategy.)

double getValue() that returns the value of the node that is pointed to by the cur pointer.

c) Write the member function Node *findFirstNodeByValue(double x) that will return the reference of the first node that has the value x. You start your search from the pointer cur.

class Node public: double v Node next;/ Points to the nert Node Node *prev/ Points to the previous Node class LList Node head public: void addNode (double v); // Add a node to the end of the link list //Member Functions here ti

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions

Question

please dont use chat gpt AI 5 0 0 .

Answered: 1 week ago

Question

What is the Principle of full compensation of demigies.

Answered: 1 week ago