【502-Week 03】学习总结 · Issue #1501 · algorithm004-02/algorithm004-02 · GitHub
Skip to content

【502-Week 03】学习总结 #1501

Description

@wangmy
  • 树的深度优先,一个个子树遍历
  • 树的广度优先,一层层扩散,像水波、地震波

什么时候可以用贪心?

  • 问题可以分解成子问题
  • 子问题最优解能递推到最终问题的最优解

贪心对每个子问题的解决方案都做出选择,不能回退。
动态规划会保存以前的运算结果,并根据当前结果对当前进行选择,支持回退。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions