wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Big O Notation

profile
Ronak Gala
Feb 16, 2023
2 Likes
2 Discussions
169 Reads

 Big-O Analysis of Algorithms

We can express algorithmic complexity using the big-O notation. For a problem of size N:

  • A constant-time function/method is “order 1” : O(1)
  • A linear-time function/method is “order N” : O(N)
  • A quadratic-time function/method is “order N squared” : O(N2 )

Definition: Let g and f be functions from the set of natural numbers to itself. The function f is said to be O(g) (read big-oh of g), if there is a constant c > 0 and a natural number n0 such that f(n) ≤ cg(n) for all n ≥ n0 .

Note: O(g) is a set!

 

 

Runtime Analysis of Algorithms

In general cases, we mainly used to measure and compare the worst-case theoretical running time complexities of algorithms for the performance analysis. 
The fastest possible running time for any algorithm is O(1), commonly referred to as Constant Running Time. In this case, the algorithm always takes the same amount of time to execute, regardless of the input size. This is the ideal runtime for an algorithm, but it’s rarely achievable. 
In actual cases, the performance (Runtime) of an algorithm depends on n, that is the size of the input or the number of operations is required for each input item. 


Comments ()


Sign in

Read Next

Memory Management

Blog banner

Types Of Interrupt

Blog banner

The Role of Fibre in Everyday Nutrition and Digestive Health

Blog banner

Rock, Paper, Scissors Game in Common Lisp

Blog banner

Direct Memory Access

Blog banner

EID UL FITR

Blog banner

Life

Blog banner

Title: Modern Operating Systems: Powering the Digital Era

Blog banner

What Your Child Learns During Free Play (That You Might Not Notice)

Blog banner

Blog on Smartsheet.

Blog banner

Linux Virtual Machine Process Scheduling

Blog banner

R Programming

Blog banner

Modern operating system

Blog banner

Data Lake

Blog banner

I/O Management and Disk Scheduling

Blog banner

Why is it hard to design an Operating Systems ?

Blog banner

Indian Culture and Tradition

Blog banner

The Lunchbox That Came Back Untouched — How to Handle a Fussy Eater at Preschool Age

Blog banner

Apple

Blog banner

Why Summer Break Is Important for Emotional and Cognitive Growth?

Blog banner

Automating OSINT tasks for efficient Cyber Forensics Investigations

Blog banner

Threat management

Blog banner

10 Survival Tips that might save your life

Blog banner

Child labour

Blog banner

Water Resources are about to exhaust...

Blog banner

Delhi city

Blog banner

Data Visualization- Importance and tools (Tableau,Power BI, Matplotlib)

Blog banner

Deadlock

Blog banner

Hash password! Is it really secured?

Blog banner

E-mail security

Blog banner

Install Ubuntu Easily

Blog banner

Use case of K-means clustering

Blog banner

OS Assignment-3

Blog banner

Memory Management

Blog banner

Define Instagram.

Blog banner

Puri Jagannath temple

Blog banner

Types Of scheduling

Blog banner

Data Visualization

Blog banner

Memory heirchy

Blog banner

Android Application Components and Activity Lifecycle

Blog banner

Modern Operating System

Blog banner

A small world of Sockets

Blog banner