Skip to content

Commit ec01391

Browse files
authored
Merge pull request #73 from lufftw/review/pattern-greedy-core
review(greedy_core): Fix duplicate separators, assess Tier 2
2 parents e36b095 + 77ac37b commit ec01391

File tree

2 files changed

+61
-11
lines changed

2 files changed

+61
-11
lines changed

docs/patterns/greedy_core/templates.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ For Greedy Core problems, the choice is typically:
6060

6161
---
6262

63-
---
64-
6563
## 5. Base Template: Jump Game (LeetCode 55)
6664

6765
> **Problem**: Determine if you can reach the last index, starting from index 0.
@@ -551,8 +549,6 @@ The "advantage" metric captures opportunity cost.
551549

552550
---
553551

554-
---
555-
556552
## 11. Pattern Comparison
557553

558554
### 11.1 Greedy Core vs Interval Greedy
@@ -592,8 +588,6 @@ The "advantage" metric captures opportunity cost.
592588

593589
---
594590

595-
---
596-
597591
## 12. Decision Flowchart
598592

599593
```
@@ -659,8 +653,6 @@ For Greedy Core problems, verify:
659653

660654
---
661655

662-
---
663-
664656
## 13. Problem Mapping
665657

666658
### 13.1 By Kernel Type
@@ -696,8 +688,6 @@ These problems use greedy but belong to other categories:
696688

697689
---
698690

699-
---
700-
701691
## 14. Template Quick Reference
702692

703693
### 14.1 1. Reachability (Can Reach End)

docs/reviews/pattern-review-log.md

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ This log records all pattern review findings, decisions, and resolutions. Each r
4747
| dp_knapsack_subset | Tier 2 | 2025-01-07 | 0/0/1/0 | Reviewed |
4848
| game_theory_dp | Pending | - | - | Queued |
4949
| graph | Tier 2 | 2025-01-07 | 0/0/1/0 | Reviewed |
50-
| greedy_core | Pending | - | - | Queued |
50+
| greedy_core | Tier 2 | 2025-01-07 | 0/0/1/0 | Reviewed |
5151
| heap | Tier 2 | 2025-01-07 | 0/0/1/0 | Reviewed |
5252
| interval | Tier 2 | 2025-01-07 | 0/0/1/0 | Reviewed |
5353
| interval_dp | Pending | - | - | Queued |
@@ -914,4 +914,64 @@ END TEMPLATE
914914

915915
---
916916

917+
## Greedy Core Review - 2025-01-07
918+
919+
### Files Reviewed
920+
- `docs/patterns/greedy_core/templates.md` (832 lines)
921+
- `docs/patterns/greedy_core/intuition.md` (220 lines)
922+
923+
### Reference Standards
924+
- Gold Standard: `sliding_window/templates.md`
925+
- Ontology Entry: `GreedyCore` from `ontology/api_kernels.toml`
926+
927+
### Findings
928+
929+
#### [GC-001]: Duplicate Section Separators
930+
931+
| Field | Value |
932+
|-------|-------|
933+
| **Category** | Engineering |
934+
| **Severity** | Minor |
935+
| **Location** | `docs/patterns/greedy_core/templates.md` (5 locations between sections 4-14) |
936+
| **Issue** | Double `---` separators appear between sections 4-5, 10-11, 11-12, 12-13, and 13-14, creating visual inconsistency. |
937+
| **Why It Matters** | Cosmetic issue affecting document consistency. Does not impact functionality. |
938+
| **Decision** | Fix |
939+
| **Resolution** | Removed duplicate separators (5 locations). |
940+
941+
### Positive Observations (Not Issues)
942+
943+
| Aspect | Assessment |
944+
|--------|------------|
945+
| **API Kernel Header** |`GreedyCore` with clear "invariant preservation" mechanism |
946+
| **Three Core Kernels** | ✅ Reachability, Prefix Min/Reset, Sort + Match clearly distinguished |
947+
| **Why NOT Interval/Heap** | ✅ Section 3 explains scope boundaries vs other greedy patterns |
948+
| **Greedy Choice Property** | ✅ Section 4 explains when greedy works |
949+
| **Pattern Variants** | ✅ 6 problems: LC 55, 45, 134, 135, 455, 1029 with full implementations |
950+
| **Code Templates Summary** | ✅ Section 14 with 6 templates covering all kernels |
951+
| **Decision Flowchart** | ✅ Section 12 with ASCII flowchart and kernel selection guide |
952+
| **When Greedy Fails** | ✅ Section 12.2 explains DP/heap scenarios |
953+
| **Problem Mapping** | ✅ Section 13 with difficulty progression |
954+
| **Intuition Quality** | ✅ Three mental models: "Farthest Reach", "Balance Sheet", "Matchmaker" |
955+
| **Common Pitfalls** | ✅ 3 pitfalls: early exit, off-by-one jumps, total feasibility |
956+
| **Practice Progression** | ✅ Level 1-6: LC 55 → 45 → 455 → 1029 → 134 → 135 |
957+
958+
### Summary
959+
960+
| Category | Critical | Major | Minor | Nit | Total |
961+
|----------|----------|-------|-------|-----|-------|
962+
| Concept | 0 | 0 | 0 | 0 | 0 |
963+
| Explanation | 0 | 0 | 0 | 0 | 0 |
964+
| Engineering | 0 | 0 | 1 | 0 | 1 |
965+
| **Total** | 0 | 0 | 1 | 0 | **1** |
966+
967+
### Tier Assessment
968+
- **Previous Tier**: Pending
969+
- **New Tier**: Tier 2 (Silver)
970+
- **Rationale**: Comprehensive greedy pattern coverage with excellent three-kernel taxonomy. The clear distinction from Interval Greedy and Heap Greedy prevents confusion. Intuition.md mental models ("Farthest Reach", "Balance Sheet", "Matchmaker") are memorable. Slightly more duplicate separators than recent patterns (5 vs 4).
971+
972+
### Action Items
973+
- [x] Fix duplicate section separators (5 locations)
974+
975+
---
976+
917977
*Pattern Review Log - NeetCode Practice Framework*

0 commit comments

Comments
 (0)