ASCI Logo
ASCI.Academy
LearnPracticeCompeteCareer
Sign InGet Started

Search ASCI Academy

Universal search across Courses, Lessons, Skills, Projects, Challenges, Competitions, Jobs, Internships, and Users

dsa

Curriculum Index

Current LevelInitiate
0/ 500 XP
Gravit Certificate:
100% Required
  • 1.1 Introduction to Big-O Notation
•
1
2
3
4
5
6
7
8
9
10
Module 1: Algorithmic Thinking & Asymptotic Analysis•Lesson 1

1.1 Introduction to Big-O Notation

### Understanding Computational Complexity
Big-O notation describes the upper bound on the time or memory space required by an algorithm as input size $n$ grows toward infinity:
- $O(1)$: Constant time (array lookup by index).
- $O(\log n)$: Logarithmic time (binary search).
- $O(n)$: Linear time (single pass through array).
- $O(n \log n)$: Linearithmic time (merge sort).
- $O(n^2)$: Quadratic time (nested comparison loops).

example.pyPython 3.11
def find_first(arr):
return arr[0] # O(1)
Python 3.11
•
Interactive Challenge
+50 XP
Challenge Objective

Return the first element of the list and print 'FIRST: 42'.

solution.py
UTF-84 SpacesAuto-saved
cpython3.11:~/workspace
CPython 3.11.8 (WASM)
$python3 -u solution.py
Click "Compile & Run" (or press Ctrl + Enter) to compile AST, verify bytecode, and execute the solution.