Algorithm Classes with Number of Operations and Execution Time
Below are the classes of algorithms and their execution times on a computer executing 1 million operation per second (1 sec = 106 μsec = 103 msec):
Big O Notation Classes | f(n) | Big O Analysis (number of operations) for n = 10 | Execution Time (1 instruction/μsec) |
---|---|---|---|
constant | O(1) | 1 | 1 μsec |
logarithmic | O(logn) | 3.32 | 3 μsec |
linear | O(n) | 10 | 10 μsec |
O(nlogn) | O(nlogn) | 33.2 | 33 μsec |
quadratic | O(n2) | 102 | 100 μsec |
cubic | O(n3) | 103 | 1msec |
exponential | O(2n) | 1024 | 10 msec |
factorial | O(n!) | 10! | 3.6288 sec |
Big O Notation Tutorial – A Guide to Big O Analysis
Big O notation is a powerful tool used in computer science to describe the time complexity or space complexity of algorithms. It provides a standardized way to compare the efficiency of different algorithms in terms of their worst-case performance. Understanding Big O notation is essential for analyzing and designing efficient algorithms.
In this tutorial, we will cover the basics of Big O notation, its significance, and how to analyze the complexity of algorithms using Big O.
Table of Content
- What is Big-O Notation?
- Definition of Big-O Notation:
- Why is Big O Notation Important?
- Properties of Big O Notation
- Common Big-O Notations
- How to Determine Big O Notation?
- Mathematical Examples of Runtime Analysis
- Algorithmic Examples of Runtime Analysis
- Algorithm Classes with Number of Operations and Execution Time
- Comparison of Big O Notation, Big Ω (Omega) Notation, and Big θ (Theta) Notation
- Frequently Asked Questions about Big O Notation
Contact Us