Graph Theory37 sections · 1633 units
Open in CourseQuiz: Lomsat gelral
Knowledge check
Check Your Understanding
Lomsat gelral: For each node, find the most frequent color in its subtree. Naive approach is . How do you optimize?
- A.Small-to-large merging (DSU on tree)
- B.Sort colors globally first
- C.Binary search on frequencies
- D.Use a hash map per node