Computer scienceAlgorithms and Data StructuresIntro to algorithms and data structuresUnderstanding algorithms and complexity analysis

Complexity cases and how to use them

Best for large input size

Report a typo

Here is a part of a table consisting of the best, average, and worst cases for different abstract algorithms. Which algorithm(s) should be our pick?

Number of Algorithm

Best Case

Average Case

Worst Case

1

O(1)O(1)

O(nlogn)O(n⋅logn)

O(nlogn)O(n⋅logn)

2

O(1)O(1)

O(n)O(n)

O(n2logn)O(n²⋅logn)

3

O(n2)O(n²)

O(n2)O(n²)

O(n2)O(n²)

4

O(n)O(n)

O(n)O(n)

O(n2)O(n²)

Based on the provided cases, which algorithm(s) would be the most suitable choice for a large input size?

Select one option from the list
___

Create a free account to access the full topic