Module 3 | Arborescent data structures, Object Oriented Programming (inheritance, polymorphism, delegation)¶
Objective¶
By the end of this module, students will be able to:
- Use and implement arborescent and recursive data structures (trees, lists, …)
- Understand and implement traversal algorithms over trees and lists (prefix, infix, suffix)
- Be able to analyze the time complexity of algorithms over arborescent data-structures
- Understand serialization of arborescent data structures
Resources¶
Slides (keynote)
- Lecture 3a Arborescent and Recursive ADT Slides
- Lecture 3a Arborescent and Recursive ADT videos
- Youtube Live 2020 Q&A Session
- Object Oriented Programming Concepts Slides
- Object Oriented Programming Concepts video
- Youtube Live 2020 Q&A Session
Files used in the slides:
Exercises: week 1¶
Restructuration 2021¶
Slides
- Source code of tree comparison:
Node.java
andTree.java
- Source code of in-order traversal:
Traversal.java
- Source code of decision trees:
DecisionTree.java
Exercises: week 2¶
Restructuration 2021¶
Slides
- Youtube Live
- Source code of the physics solver:
PhysicsSolver.java
Design exercise¶
Implement this interface with three different classes Circle, Square, Triangle.
public interface Shape {
public void draw();
public void erase();
}
- Each method should print something to the console like “drawing a circle”.
- Now implement one class RandomShape that randomly draw a circle, a square or a triangle by flipping a coin.
- What are the OOP principles that you are using here ?
- Can your design easily be used to also include rectangles in the RandomShape ?