DAA Module 2 03 / 04

Best, Average & Worst Case

Same algorithm, different inputs.

← Prev Next →
n = 20 position = 1
Linear Search Insight

Best: element at start → O(1)
Worst: element at end → O(n)
Average: somewhere in middle → O(n)