212k views
1 vote
When do quadratic algorithms become impractical? Cubic algorithms?

1 Answer

3 votes

Answer:

Quadratic algorithms O(n²)

The execution time of a program is proportional to the square of the input size. Examples: insertion sort,selection sort etc.

If the input becomes big,as the time complexity is O(n²) it will take much time and it is quite senseless to wait this much time for a program.

The quadratic algorithms become impractical when-

Input> few thousands

Cubic algorithm O(n³)

The execution time of a program is proportional to the cubic of the input size.

Examples:Deeper nested iterations will result in O(N³)

If the input becomes big,as the time complexity is O(n³) it will take much time and it is quite senseless to wait this much time for a program.

The cubic algorithms become impractical when-

Input<few hundreds

User Webdesigner
by
5.5k points