1. Engineering
  2. Computer Science
  3. write a function implementation that overloads the operator of...

Question: write a function implementation that overloads the operator of...

Question details

1. Write a function implementation that overloads the operator of a dynamic sequence container (inked list) class to test if two object have the same data sets. 2. What type of structure (static array, dynamic amay linked list, doubly linked list, stack or queue) would you use to manipulate a simple grocery list? Explain why the other structures would not work as well. 3. Explain at least two emors that can occur when using a stack. What can be done (as part of a stack class) to ensure the errors do not cause data emors? What can be done (as part of the program using the stack to ensure the errors do not occur? 4. Show the state of the private member variables of s before and after each line of the code executes. You can number the lines for reference. (the Stack class below is implemented using a linked list) Stack int s; s.push(1); push (2); push (3); cout <<s pop(): 5. Describe why it is a bad idea to implement a linked list version a queue which uses the head of the list as the rear of the queue. What would you need to do if you wanted to implement a queue in this fashion. 6. Implement the following function as a new function for the linked list toolkit. (Use the usual Node definition with member variables called data and link) Document your code. node<int is at (nodekint head ptr nodekint p) Precondition: head ptr is the head pointer of a linked list (which may be empty). The pointer p is a non-NULL pointer to some Node on some linked list. Postcondition: The return value is the location of p on the list. If p is not contained within list pointed to by head ptr, return NULL
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution