Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given the following singly-linked node class and variable declarations, answer questions 5.1-5.2 12 struct node 13 14 node *next; 15 16 i 17 18 class

image text in transcribed
image text in transcribed
Given the following singly-linked node class and variable declarations, answer questions 5.1-5.2 12 struct node 13 14 node *next; 15 16 i 17 18 class Listf 19 private: 20 int size; 21 22 node *tail; 23 public: 24 25 26 List(const int &value)( int data node *head; size-e;} List ( ){head = NULL; tail //another constructor NULL; = node *temp = new node(); temp->datavalue; head-temp: tail-temp; size++i 28 30 31 5.1 Examine the code of the following unnamed member function (void xxx (0) of Class List, what is the best name you would give to this function? The name should best reflect what the function performs. Briefly justify your answer. [2 points] 81 void xxxx ( 83 84 85 node *temp new node; temp shead; while (temp !=NULL){ cout data next 87 89 90 5.2 Complete the following C++ code for void insert_start(int value), replace ??? with the correct expression(s). This function inserts an element (value) at the start of the list.[4 points] 30 void insert start(int value) 31 32 node *temp new node); temp->data??? temp->next = ?? if (head-NULL) 34 tail-???: 35 36 37 38 39 40 head = ???; size++i

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

Students also viewed these Databases questions

Question

Define and describe the elements of group problem solving.

Answered: 1 week ago