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

CSE205 Lecture 22

CSE205 Lecture 22

Object-Oriented Programming and Data Structures
Connecting the Dots II
(202111)

Javier Gonzalez-Sanchez

October 02, 2021
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. jgs
    CSE 205
    Object-Oriented Programming and
    Data Structures
    Lecture 22: Connecting the Dots
    Dr. Javier Gonzalez-Sanchez
    [email protected]
    javiergs.engineering.asu.edu | javiergs.com
    PERALTA 230U
    Office Hours: By appointment

    View full-size slide

  2. jgs
    Nuts and bolts of Binary Trees
    Traverse

    View full-size slide

  3. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 3
    jgs
    Tree | Traverse In Order
    public void traverseInOrder(Node node) {
    if (node != null) {
    traverseInOrder(node.left);
    System.out.print(" " + node.value);
    traverseInOrder(node.right);
    }
    }

    View full-size slide

  4. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 4
    jgs
    Tree | Traverse In Order

    View full-size slide

  5. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 5
    jgs
    Tree | Traverse Pre Order
    public void traverseInOrder(Node node) {
    if (node != null) {
    System.out.print(" " + node.value);
    traverseInOrder(node.left);
    traverseInOrder(node.right);
    }
    }

    View full-size slide

  6. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 6
    jgs
    Tree | Traverse Pre Order

    View full-size slide

  7. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 7
    jgs
    Tree | Traverse Post Order
    public void traverseInOrder(Node node) {
    if (node != null) {
    traverseInOrder(node.left);
    traverseInOrder(node.right);
    System.out.print(" " + node.value);
    }
    }

    View full-size slide

  8. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 8
    jgs
    Tree | Traverse Post Order

    View full-size slide

  9. jgs
    Connecting the Dots
    Assignment 05

    View full-size slide

  10. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 10
    jgs
    Step 1

    View full-size slide

  11. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 11
    jgs
    Step 2

    View full-size slide

  12. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 12
    jgs
    Step 3. Undo

    View full-size slide

  13. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 13
    jgs
    Step 4. Erase

    View full-size slide

  14. jgs
    Let’s Do This
    Assignment 05

    View full-size slide

  15. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 19
    jgs
    Release 1. GUI

    View full-size slide

  16. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 21
    jgs
    Release 2. Action Listeners

    View full-size slide

  17. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 23
    jgs
    Release 3. Draw Area

    View full-size slide

  18. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 26
    jgs
    Release 4. Mouse Listeners

    View full-size slide

  19. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 28
    jgs
    MouseListener
    § public void mousePressed (MouseEvent e) {}
    § public void mouseClicked(MouseEvent e) { }
    § public void mouseReleased(MouseEvent e) { }
    § public void mouseEntered(MouseEvent e) { }
    § public void mouseExited(MouseEvent e) { }
    § public void mouseDragged(MouseEvent me) { }
    § public void mouseMoved(MouseEvent e) { }

    View full-size slide

  20. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 29
    jgs
    MouseMotionListener
    § public void mouseDragged(MouseEvent me) { }
    § public void mouseMoved(MouseEvent e) { }

    View full-size slide

  21. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 30
    jgs
    Release 5. Draw + Mouse

    View full-size slide

  22. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 32
    jgs
    Release 5. Stack of Shapes

    View full-size slide

  23. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 33
    jgs
    Questions

    View full-size slide

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

    View full-size slide