Question

This exercise is to exam the dynamic behavior of the working pointers the following Methods: Add...

This exercise is to exam the dynamic behavior of the working pointers the following Methods:

  • Add(item) and Remove(item) for LInkedQueue
  • push(item), pop(item) and top() for LinkedStack

Place an A4 paper in landscape orientation, draw the illustration on the left half and write the corresponding C++ code directly to its right. The main focus of the Illustration is to show the relationship between the list elements with the working pointers in the program.

Group your illustration in (test) scenarios of

  1. empty Linked Container;
  2. one item Linked Container;
  3. more than one-item Linked Container.

Use the illustrated convention to present the class for pointer movement, modification, and end of list.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Following are the illustration and corresponding c++ codes of the mentioned functions:

( Note: As the illustration were too large to be fitted on a single page illustration for "Add(Item) for more than one item list" is done on a separate page, rest of the functions are on single page) :

inked Queue 1) Additem) Ct+ Cod Llustration ) Empty Linted Container initial stale: != NULL)//re, there w smu |value llavaila111〉 Add Item for More than 0ne tem linked Container: Illustration inital ront recr Value Yaulut neu. item 1 Value nex NULL 1Kemovc1tem for inkd Cveue inked Contruiner lfronH_추NUIL nothing to Remor Ilcaue 1 Crear NULL) 2) one Item inked container utulinked Sack Iustration C Code rush ( node xx top, unt key) ) posh (item) i) Empt^ linked Container 饈 NULL ASter Push to lcasLinkea Stack 5 2) pop Ciuem (1) Empty 나 pop (nodeそ tar ) NULL . underflow error 41) One Itan it: ィ Cout << ,, under Row . toopfrinked Stack aid top C node.ギtop) ( t op = NULL ) return eliet ( print to -) val ) ) Mort an One 1 lem lis+ Val Vol

Add a comment
Know the answer?
Add Answer to:
This exercise is to exam the dynamic behavior of the working pointers the following Methods: Add...
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
  • Lab 3 – Array-Based Stack and Queue Overview In this assignment, you will be implementing your...

    Lab 3 – Array-Based Stack and Queue Overview In this assignment, you will be implementing your own Array-Based Stack (ABS) and Array-Based Queue (ABQ). A stack is a linear data structure which follows the Last-In, First-Out (LIFO) property. LIFO means that the data most recently added is the first data to be removed. (Imagine a stack of books, or a stack of papers on a desk—the first one to be removed is the last one placed on top.) A queue...

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