Question

Exercise-2: 15 points Develop a node class and a doubly list class. The node class should have two state variables namely dat
0 0
Add a comment Improve this question Transcribed image text
Answer #1


uckile (L.ment poaton) P nent stoue nextp-next d. → Null heods nea-nede 米Tsot anode at de end- shile (n-next ! NDLL) p →heut-e nea made indo dhe widdle fe inkel List st ruct Node [ ind dalo, YeuNade_A data -dataゾ Node* ¥ else f→ veut-A neut get Node (N); hend rest ode (s Cout Linke ist befove insetion: dis plaw nead -Зі nsent Atd hnd, ) out 4In in#Insent the mole end of list:- eod-se ,int hew stuct Node) Struck Node老last. * head. Jef; reco-mode --data -hea)-data; oef Netemp = temp-anent vee temp vaid paöntbst (ut ntde tode olile (hade N int mainC) push巡head , 1); push ( head 1 2) uts (createshuut Nodet mt dato shuct Node toid push Chuck Nae** head켜 , iut mo-data) meu-mode-a data mew- dała, (# head Jef) ncw node stin mint) push () push (4, 2) Push (ม12, 8); push(n, 5), Roiwt Second ist (,) 米Reverse de mode int dato sruct Node * mext Nodevoid eenset) Node prey-cunent curvlent next, heod -prev struct Nde temp : head) coud ee temp-adoto temp-temp-うYCub ㄥㄥ vaidIn moin) push (0) push ( Ipuhis) push(s) しし

Add a comment
Know the answer?
Add Answer to:
Exercise-2: 15 points Develop a node class and a doubly list class. The node class should have tw...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Exercise-1:15 points Develop a node class and a singly list class. The node class should have two...

    Exercise-1:15 points Develop a node class and a singly list class. The node class should have two state variables namely data and nextNode. The singly list class should contain the following methods . Middlelnsert-insert a node somewhere in the middle of the list . Startinsert-insert a node at start of the Linked list Endinsert-insert a node at the end of the Linked list . Delete-delete a node Traverse-prints all the node's data Reverse -reverses the linked list Note: Choose appropriate...

  • implement a doubly-linked list in C. Each node in the linked list should contain a string,...

    implement a doubly-linked list in C. Each node in the linked list should contain a string, a pointer to the previous node (or NULL), and a pointer to the next node (or NULL). The nodes should be sorted by their strings. struct node_t { char* str; struct node_t* prev; struct node_t* next; } To maintain the doubly-linked list, you should keep a pointer to the head node of the list (or NULL if the list is empty), and a pointer...

  • using C++, NOT C language 1. Write a function called insert() to insert a node to...

    using C++, NOT C language 1. Write a function called insert() to insert a node to the beginning of a linked list. The data is passed into the function. For example insert(8) will insert a node at the beginning of the list with the number 8 in the data field. Each node in the linked list is a ListNode struct as discussed in class. 2. Write a function called print() that will traverse the entire linked list and print out...

  • I need this in C++. This is all one question Program 2: Linked List Class For...

    I need this in C++. This is all one question Program 2: Linked List Class For this problem, let us take the linked list we wrote in a functional manner in a previous assignment and convert it into a Linked List class. For extra practice with pointers we'll expand its functionality and make it a doubly linked list with the ability to traverse in both directions. Since the list is doubly linked, each node will have the following structure: struct...

  • c++ only Program 2: Linked List Class For this problem, let us take the linked list...

    c++ only Program 2: Linked List Class For this problem, let us take the linked list we wrote in a functional manner in a previous assignment and convert it into a Linked List class. For extra practice with pointers we’ll expand its functionality and make it a doubly linked list with the ability to traverse in both directions.    Since the list is doubly linked, each node will have the following structure: struct Node { int number; Node * nextNode;...

  • BELOW IS THE CODE I ALREADY HAVE Linked List - Delete Modify Lab 5 and include...

    BELOW IS THE CODE I ALREADY HAVE Linked List - Delete Modify Lab 5 and include the method to delete a node from the Linked List. In summary: 1) Add the method Delete 2) Method call to delete, with a number that IS in the list 3) Method call to delete, with a number that is NOT in the list - Be sure to include comments - Use meaningful identifier names (constants where appropriate) import java.io.*; 1/ Java program to...

  • linked list operation /*************************************************************************************** This function creates a new node with the information give as a...

    linked list operation /*************************************************************************************** This function creates a new node with the information give as a parameter and looks for the right place to insert it in order to keep the list organized ****************************************************************************************/ void insertNode(string first_name, string last_name, string phoneNumber) { ContactNode *newNode; ContactNode *nodePtr; ContactNode *previousNode = nullptr; newNode = new ContactNode; /***** assign new contact info to the new node here *****/ if (!head) // head points to nullptr meaning list is empty { head = newNode;...

  • Design and implement your own linked list class to hold a sorted list of integers in ascending order. The class should h...

    Design and implement your own linked list class to hold a sorted list of integers in ascending order. The class should have member function for inserting an item in the list, deleting an item from the list, and searching the list for an item. Note: the search function should return the position of the item in the list (first item at position 0) and -1 if not found. In addition, it should member functions to display the list, check if...

  • Please write a c++ header file, class implementation file and main file that does all of...

    Please write a c++ header file, class implementation file and main file that does all of the following and meets the requirements listed below. Also include a Output of your code as to show that your program works and functions properly. EXERCISING A DOUBLY-LINKED LIST CLASS This project consists of two parts, the second of which appears below. For the first part, write a class that implements an unordered list abstract data type using a doubly-linked list with pointers to...

  • Problem 3 will have the following class Node. static class Node { public char data; public...

    Problem 3 will have the following class Node. static class Node { public char data; public Node next; public Node previous; }; 3. Answer all the sub-questions but for the following circular doubly-linked list with the external reference P2 given in the below figure, write the statements of each following question. You can only use pointer P2 to access the doubly-linked list, write program statements to do the following, each question is independent based on the original status. 1) Display...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT