PART 1
|
Pop and Peek Operations |
Prior to beginning this interactive assignment, review Chapter 4 in Data Structures and Algorithm Analysis” href=”http://people.cs.vt.edu/~shaffer/Book/JAVA3elatest.pdf” target=”_blank” class=”external” rel=”noreferrer noopener”>Data Structures and Algorithm Analysis (Links to an external site.) , Chapter 2 in Data Structures Essentials, and review the Stacks (Links to an external site.) website. Lysecky indicates that “Pop and Peek operations should not be applied to an empty stack; the resulting behavior may be undefined” (2015, section 2.10). In your initial post, explain whether you think this is a problem. Justify your answers with citations from credible resources as outlined in the Scholarly, Peer Reviewed, and Other Credible Sources (Links to an external site.) table.
Students: Be sure to download and save a PDF version of your textbook for future reference. It will be used in later courses within your program, including the final, capstone course. Zybooks limits online access to your course textbooks to a 12-month period. (Zybook Download Instructions.docx” href=”https://ashford.instructure.com/courses/86909/files/15849593/download?wrap=1″ data-api-endpoint=”https://ashford.instructure.com/api/v1/courses/713/files/6354497″ data-api-returntype=”File” aria-expanded=”false” aria-controls=”preview_1″>Zybook Download Instructions
As part of the post, provide a snippet of code that utilizes the Pop and Peek operations on a stack that is not empty. Provide an explanation of your snippet. Your initial post must be a minimum of 250 words.
PART 2
|
Queue Implementation |
Prior to beginning this discussion, review Chapter 4 in Data Structures and Algorithm Analysis (Links to an external site.) , Chapter 2 in Data Structures Essentials, the Interface Queue <E> (Links to an external site.) web page, and the Implement the Queue in Java (Links to an external site.) article.
Students: Be sure to download and save a PDF version of your textbook for future reference. It will be used in later courses within your program, including the final, capstone course. Zybooks limits online access to your course textbooks to a 12-month period. (Zybook Download Instructions
In this post, utilize the queue function by creating a Java program that uses the add(), element(), offer(), peek(), and poll() methods for the queue function. Post your code and provide an explanation of your code and what each method is performing in relationship to your code. Your initial post must be a minimum of 250 words.


0 comments