patternMinor
"Which complexity represents a majority of algorithms?"
Viewed 0 times
majorityalgorithmswhichrepresentscomplexity
Problem
Student asked me this question. During lectures on algorithm complexity I've shown similar picture (source):
After I've explained and gave examples for each category, a student asked: "Which of these represent a majority of algorithms?" I guess that the question is not right in a sense that we are creating new algorithms and that it depends on the field - majority of sorting algorithms are more complex than nlogn.
What would be your answer?
This question is only about the Big O as that was the end of the lecture.
Thanks!
After I've explained and gave examples for each category, a student asked: "Which of these represent a majority of algorithms?" I guess that the question is not right in a sense that we are creating new algorithms and that it depends on the field - majority of sorting algorithms are more complex than nlogn.
What would be your answer?
This question is only about the Big O as that was the end of the lecture.
Thanks!
Solution
My answer would be that there is no running time that represents the majority of algorithms. Some common algorithms (for example, BFS and DFS) run in linear time; some run in loglinear time (for example, sorting); dynamic programming algorithms run in superlinear polynomial time (for example, the standard algorithm for edit distance runs in quadratic time); algorithms involving matrix multiplication run (practically) in cubic time, and theoretically faster; SAT solvers have worst case exponential running time; and some algorithms involved in verification have even faster growing worst case running time, or are not guaranteed to terminate at all.
Context
StackExchange Computer Science Q#95987, answer score: 2
Revisions (0)
No revisions yet.