Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CSE205 Lecture 19

CSE205 Lecture 19

Object-Oriented Programming and Data Structures
Stack and Queue
(202204)

Javier Gonzalez-Sanchez

September 29, 2021
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. jgs CSE 205 Object-Oriented Programming and Data Structures Lecture 19:

    Stack and Queue Dr. Javier Gonzalez-Sanchez [email protected] javiergs.engineering.asu.edu | javiergs.com PERALTA 230U Office Hours: By appointment
  2. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 2 jgs

    Homework 04 This assignment is about implementing (from Scratch) the Classes MyNode, MyList, MyStack, and MyQueue. These classes should be Generic, i.e., use parametrized types. Implement the following methods: a) For MyList: instertFirst(), insertAt(), insertLast(), removeFirst(), removeAt(), removeLast(), printAll() b) For MyStack: push(), pop() c) For MyQueue: enqueue(), dequeue() Finally, create a Class Main with a method main() in which you a) create objects MyList, MyStack and MyQueue with data of type String. Insert, remove and print elements using your methods. Test all of them. b) reuse a class Student or Triangle or similar from previous assignments and create objects MyList, MyStack and MyQueue with data of that type. Insert, remove and print elements using your methods. Test all of them. Total Number of Classes to submit: ~7
  3. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 4 jgs

    I introduce you a List, a Linked List
  4. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 6 jgs

    I introduce you a List, a Linked List
  5. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 7 jgs

    I introduce you a List, a Linked List
  6. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 9 jgs

    I introduce you a List, a Linked List
  7. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 11 jgs

    Homework 04 This assignment is about implementing (from Scratch) the Classes MyNode, MyList, MyStack, and MyQueue. These classes should be Generic, i.e., use parametrized types. Implement the following methods: a) For MyList: instertFirst(), insertAt(), insertLast(), removeFirst(), removeAt(), removeLast(), printAll() b) For MyStack: push(), pop() c) For MyQueue: enqueue(), dequeue() Finally, create a Class Main with a method main() in which you a) create objects MyList, MyStack and MyQueue with data of type String. Insert, remove and print elements using your methods. Test all of them. b) reuse a class Student or Triangle or similar from previous assignments and create objects MyList, MyStack and MyQueue with data of that type. Insert, remove and print elements using your methods. Test all of them. Total Number of Classes to submit: ~7
  8. jgs CSE 205 Object-Oriented Programming and Data Structures Javier Gonzalez-Sanchez,

    Ph.D. [email protected] Fall 2021 Copyright. These slides can only be used as study material for the class CSE205 at Arizona State University. They cannot be distributed or used for another purpose.