{% extends "base.html" %} {% block title %}ADA Theory | Algorithm Analyzer, Mohammed Usman{% endblock %} {% block content %}

Analysis Tools

Theory Reference

{% if ref_data %}

â–¸ BIG-O REFERENCE

{% for item in ref_data.big_o %} {% endfor %}
NotationNameExampleClass
{{ item.notation }} {{ item.name }} {{ item.example }} {{ item.class }}
{% else %}

Master Theorem

T(n) = aT(n/b) + f(n)

Solves divide-and-conquer recurrences. Three cases based on comparison of f(n) and n^(log_b a).

Amortized Analysis

Aggregate | Accounting | Potential

Average cost per operation over a sequence. Dynamic arrays: O(1) amortized per insertion.

{% endif %}
{% if result %}

Analysis Result

{% if result.execution_time_ms is defined %}
Time (ms)
{{ "%.4f"|format(result.execution_time_ms) }}
Memory
{{ "%.2f"|format(result.memory_used_kb) }} KB
{% endif %}
{% if result.solution is defined %}Solution: {{ result.solution }}
{% endif %} {% if result.case is defined %}Case: {{ result.case }}
{% endif %} {% if result.explanation is defined %}Explanation: {{ result.explanation }}
{% endif %} {% if result.tree is defined %} Recursion Tree:
{% for level in result.tree %} Level {{ level.level }}: {{ level.nodes }} nodes, size={{ "%.2f"|format(level.subproblem_size) }}, cost={{ "%.2f"|format(level.cost) }}
{% endfor %} Total Cost ≈ {{ "%.2f"|format(result.total_cost_approx) }}
{% endif %} {% if result.amortized_cost is defined %}Amortized Cost: {{ "%.2f"|format(result.amortized_cost) }} per operation
{% endif %} {% if result.expected_hires is defined %}Expected Hires: {{ "%.2f"|format(result.expected_hires) }}
{% endif %} {% if result.expected_comparisons is defined %}Expected Comparisons: {{ "%.0f"|format(result.expected_comparisons) }}
{% endif %}
{% endif %} {% if ref_data and ref_data.np %}

NP-Completeness Reference

{% for cls in ref_data.np.complexity_classes %}

{{ cls.class }}

{{ cls.definition }}

{% for ex in cls.examples %}{{ ex }}{% endfor %}
{% endfor %}
{% endif %} {% if ref_data and ref_data.paradigms %}

Paradigm Comparison

{% for p in ref_data.paradigms %} {% endfor %}
ParadigmApproachExamplesWhen to Use
{{ p.paradigm }} {{ p.approach }} {% for ex in p.examples %}{{ ex }}{% endfor %} {{ p.when_to_use }}
{% endif %} {% endblock %} {% block extra_scripts %} {% endblock %}