Question: Please help me with the output and also understand it! Please read carefully. Full points will be awarded, thanks in advance Linked List Problem The
Please help me with the output and also understand it! Please read carefully.
Full points will be awarded, thanks in advance


Linked List Problem The following code implements a linked list of single characters. Note that this list has no dummy node between the head and the first node #include iostream> using namespace std; class List public: List( char data; void show): void doSomethingFunl); void doSomethingFun2); private: struct Node char item; Node next; Node *head; List::List( char data ) Node *currentNULL Node *prevNULL; for ( int i-4; 1 >-1; 1.. ) { currentnew Node; current->item = data + i; current->nextprev: 1 head- current; prev current; void List:: show) for ( Node *current = head; current NULL; current = current->next ) cout item "->"; cout item current->item born ->nextcurrent->next; current->next born; current - current->next->next; void List: :doSomethingFun2{ Node *next NULL, *tail-NULL ; for ( Node *current head ; current-NULL ; current next ) { next - current->next; if ( currenthead) continue; if ( current->next = NULL ) { tail-current break; delete current if (headNULL head->next tail; int main( int argc, char argv[ List list('0'; list.show // 1st list.show) list.doSomethingFun1 ; list.show // 2nd list.show( ) list.doSomethingFun2 ) list.show); I/ 3rd list.show) Write an output by the 1st. 2nd, and 3rd list.show)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
