{% extends "base.html" %} {% block title %}Greedy Algorithms | USSU Algorithm Analyzer v4.0 {% if result %}
{{ result.algorithm }} — {{ result.iterations }} greedy choices made, {{ result.comparisons }} comparisons.
At each step, made locally optimal decision without reconsideration. Proof by exchange argument or matroid theory.
Solution found in {{ "%.4f"|format(result.execution_time_ms) }}ms. Complexity: {{ result.time_complexity }}.
Activity Selection, Fractional Knapsack, Huffman Coding, Job Sequencing, and Minimum Coins.
Sort by finish time, greedily pick compatible activities. Classic greedy proof by exchange argument.
Sort by value/weight ratio, take fractions. Unlike 0/1 knapsack, greedy works here.
Build optimal prefix-free binary code using min-heap. Minimizes expected code length.
{{ result.algorithm }} — {{ result.iterations }} greedy choices made, {{ result.comparisons }} comparisons.
At each step, made locally optimal decision without reconsideration. Proof by exchange argument or matroid theory.
Solution found in {{ "%.4f"|format(result.execution_time_ms) }}ms. Complexity: {{ result.time_complexity }}.
{{ result.algorithm }} — {{ result.iterations }} greedy choices made, {{ result.comparisons }} comparisons.
At each step, made locally optimal decision without reconsideration. Proof by exchange argument or matroid theory.
Solution found in {{ "%.4f"|format(result.execution_time_ms) }}ms. Complexity: {{ result.time_complexity }}.