Answer to Question #287702 in C++ for Roe

Question #287702

Note:


1)|| is a doubly link in the above


2)test it in main


3)Try not to make any global declarations if possible




TASK:


Write program using linked list implementation and implement the following link list :



a->Apple->Ali


||


b->Bored->Bat


||


c->Cat->Cow




1
Expert's answer
2022-01-15T09:18:42-0500



// a linked list
#include <bits/stdc++.h>
using namespace std;
 
class Node {
public:
    int data;
    Node* next;
};
 

int main()
{
    Node* head = NULL;
    Node* second = NULL;
    
 
    // allocate 2 nodes in the heap
    head = new Node();
    second = new Node();
    
    head->data = apple; // assign data in first node
    head->next = Alli

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment