wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Big O Notation

profile
Ronak Gala
Feb 16, 2023
2 Likes
2 Discussions
170 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

My First Trek - Sondai, Karjat - Shoaib Malik

Blog banner

GIS

Blog banner

The Evolution of the Microprocessor ~ Aditya Pai

Blog banner

Deadlock and Starvation

Blog banner

Direct Memory Access

Blog banner

Global versus Indian Mental Health Differences

Blog banner

Image Steganography: Hiding Secrets in Plain Sight

Blog banner

A little bit of salt is all the hash needs!

Blog banner

Big Data Architecture

Blog banner

INTRODUCTION

Blog banner

Top Career Paths After a B.Com Degree in Mumbai: What’s Next for You?

Blog banner

An Overview of Virtual Machines

Blog banner

OS- Assignnment 1

Blog banner

DATA SCIENCE IN BUSINESS AND MARKETING

Blog banner

Game via listing method

Blog banner

Full Disk Encryption on Digital Forensics

Blog banner

Review on Recovering Deleted Files

Blog banner

IO Buffers

Blog banner

Mumbai

Blog banner

A Day in the Life at Elzee: What Your Child Does Between Drop-Off and Pick-Up

Blog banner

Im Photographer

Blog banner

Evolution of Operating system

Blog banner

10 Reasons Why Guy BestFriends are the Must in Every Girl's Life

Blog banner

Smartphone Security: Vulnerabilities and Attacks

Blog banner

A Deep Dive

Blog banner

E-Cash (Electronic Cash)

Blog banner

Why Businesses Are Investing More in Automation than Advertising?

Blog banner

Save Environment

Blog banner

IT RISK

Blog banner

Types of Threads

Blog banner

LinkedIn

Blog banner

VIRTUAL MACHINES

Blog banner

LEMON PICKLE SWEET AND MILD HOT

Blog banner

Way to make your meal healthier.

Blog banner

Wrike

Blog banner

Hacking

Blog banner

KAHAWA TEA

Blog banner

MEMORY MANAGEMENT

Blog banner

World’s rarest passport owned by 500 people.

Blog banner

Navigating the Digital Battlefield: Security Breaches and Effective Countermeasures

Blog banner

What is OS Fingerprinting?

Blog banner

10 Unknown facts about India's Independence

Blog banner