cs2381 Notes: 25 Semester Review
··1 min
This Semester
- Intermediate Programming
- Data Structures
- In Java
Data in Python vs. Java
- Core data types are similar:
- Python: int, float, string, boolean, list, dict, set
- Java: int, double, String, boolean, ArrayList, HashMap, HashSet
- Most obvious difference is explicit type declarations.
- Thats a property of a static vs dynamically typed language.
- You can’t do
[1, 2, "a", "b"]
in Java without extra steps.
Design Recipe
- Javadoc
- Stub
- Tests
- Standard pattern
- Body
A method’s type signature generally implies a standard pattern. Show standard patterns for atomic types, String as atomic, String as sequence.
Static vs. Instance Methods
- Java doesn’t have syntactic functions.
- Everything must be in a class.
- But it does have static methods.
Lists
- Arrays -> ArrayList
- ArrayList standard pattern
- Recursive data -> ConsList
- ConsList standard patterns (static, instance)
- Generic type parameters
- List interface
- Iterators
Stacks and Queues
- Exist
Threads
- Data races
- Mutexes
- Deadlocks
Sets
- Concept
- Binary Search Trees
- Hash Tables
Dictionaries
- Basically like sets.
Priority Queues
- Heaps
- Graphs
- Dijkstra’s Algo
Networking / Word Game
- You are here.