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:
2026-06-24 17:28:20 +05:30
parent 09a7b69d89
commit 46c6ba133c
2 changed files with 52 additions and 0 deletions

View File

@@ -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