wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Big O Notation

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

Man In The Middle Attack

Blog banner

Fitness

Blog banner

Real-Time Operating Systems (RTOS) Deep Explanation

Blog banner

I/O Management and Disk Scheduling

Blog banner

R Programming

Blog banner

EFT

Blog banner

Different memory allocation strategies

Blog banner

Love is in air.....

Blog banner

MORDERN UNIX SYSTEM

Blog banner

The Memory Hierarchy

Blog banner

Predictive Analysis - Ek Overview

Blog banner

RAID

Blog banner

Disk scheduling

Blog banner

Life of an army person

Blog banner

Memory Partitioning

Blog banner

Data Visualization – Importance and tools (Tableau, Power BI)

Blog banner

LEMON PICKLE (NIMBU KA ACHAR)

Blog banner

Understanding Input Based Keylogger Activation Systems: Risks and Mitigation

Blog banner

Memory Management

Blog banner

Why is online marketing is important in current scenario

Blog banner

Getting into Anime

Blog banner

Service Validation and Testing during the Design Phase

Blog banner

Wiretapping

Blog banner

Online Education

Blog banner

Network Security Risks

Blog banner

Emerging threats in cyber Forensics

Blog banner

Disk Management

Blog banner

Understanding Toddler Tantrums: What They Really Mean

Blog banner

Spyware

Blog banner

Different Types of Data

Blog banner

DBMS and various career options related to it.

Blog banner

Os Virtual Memory

Blog banner

Traditional UNIX Scheduling

Blog banner

Process and Threading

Blog banner

What is a Dumpster Diving Attack?

Blog banner

Session Vulnerabilities

Blog banner

Skills An Ethical Hacker Must Have

Blog banner

Deadlocks in operating system

Blog banner

Service transition principles

Blog banner

VIRTUAL MACHINE

Blog banner

security controls

Blog banner

Cache memory

Blog banner