Strategy: sync post code blocks to repo exactly, split merged BubbleSort/MergeSort/QuickSort block (fixing non-compiling stub methods), Java 25, H6 file labels, fix stale console output, README mapping
This commit is contained in:
19
README.md
19
README.md
@@ -426,6 +426,25 @@ javac 03-behavioral/state/*.java -d out/state
|
||||
java -cp out/state state.Main
|
||||
```
|
||||
|
||||
### Strategy (`03-behavioral/strategy/`)
|
||||
|
||||
| Post Section | File(s) |
|
||||
|---|---|
|
||||
| Implementation: Pluggable Sorting — the Strategy interface | `SortStrategy.java` |
|
||||
| Implementation: Pluggable Sorting — BubbleSort | `BubbleSort.java` |
|
||||
| Implementation: Pluggable Sorting — MergeSort | `MergeSort.java` |
|
||||
| Implementation: Pluggable Sorting — QuickSort | `QuickSort.java` |
|
||||
| Implementation: Pluggable Sorting — the Context (Sorter) | `Sorter.java` |
|
||||
| Implementation: Pluggable Sorting — wiring it together | `Main.java` |
|
||||
|
||||
Note: the "Strategy in Java 8+: Lambdas as Strategies" snippet is illustrative only — it is not part of this repository's runnable example.
|
||||
|
||||
Run it:
|
||||
```bash
|
||||
javac 03-behavioral/strategy/*.java -d out/strategy
|
||||
java -cp out/strategy strategy.Main
|
||||
```
|
||||
|
||||
## Reference
|
||||
|
||||
- *Design Patterns: Elements of Reusable Object-Oriented Software* — Gamma, Helm, Johnson, Vlissides
|
||||
|
||||
Reference in New Issue
Block a user