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...

  • 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...

  • 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...

  • LAB: Inserting an integer in descending order (doubly-linked list) Given main() and an IntNode class, complete...

    LAB: Inserting an integer in descending order (doubly-linked list) Given main() and an IntNode class, complete the IntList class (a linked list of IntNodes) by writing the insertInDescendingOrder() method to insert new IntNodes into the IntList in descending order. Ex. If the input is: 3 4 2 5 1 6 7 9 8 -1 the output is: 9 8 7 6 5 4 3 2 1 ___________________________________________________________________________________________________________________________________________________ SortedList.java (READ ONLY!!!) import java.util.Scanner; public class SortedList { public static void main...

  • Linked List in Java The data node should be modeled somewhat like this: class node{ int...

    Linked List in Java The data node should be modeled somewhat like this: class node{ int node iNum; node next; } Write a program that creates a linked list and loads it with the numbers 0 to 9. Start with an empty list and then use a "for loop" to fill it. Create a linked list class, a node class, etc. Routines like makeNode and findTail should be methods in the linked list class. Create a showList function to display...

  • C++ Create a class that implements a sorted, doubly-linked list: Start with a copy of the...

    C++ Create a class that implements a sorted, doubly-linked list: Start with a copy of the sortedList class. Call your new class doublyLinkedList. Convert the baseline code into a doubly linkedlist, and thoroughly test all existing operations (make sure to check all edge conditions), and then implement the new operations below. The class should have the following additional class methods: • A reverse method: this method will reverse the order of the doubly linked list. This method takes no parameters,...

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
ADVERTISEMENT