
TIME COMPLEXITY A LEVEL
Presentation
•
Computers
•
12th Grade
•
Practice Problem
•
Hard
SAMANTHA NICOLE
Used 1+ times
FREE Resource
9 Slides • 0 Questions
1
2
What is time complexity
Time complexity is a measure of how the runtime of an algorithm increases with respect to the input size (n). It helps us evaluate the efficiency of an algorithm.
3
Common Types of Time Complexity:
Constant Time – O(1)
The execution time remains the same regardless of input size.
Example: Accessing an element in an array by index → arr[5]
4
The runtime grows slowly as the input size increases.
Example: Binary search (dividing the problem in half each step).
Linear Time – O(n
The runtime increases proportionally with the input size.
Example: Iterating through an array → for i in range(n)
Logarithmic Time – O(log n)
5
The runtime grows proportionally to the square of the input size.
Example: Nested loops iterating through an array → for i in range(n): for j in range(n):
Quadratic Time – O(n^2)
The runtime is a combination of linear and logarithmic growth.
Example: Efficient sorting algorithms like Merge Sort and Quick Sort (average case).
Linearithmic Time – O(nlogn)
6
The runtime grows slowly as the input size increases.
Example: Binary search (dividing the problem in half each step).
Linear Time – O(n
The runtime increases proportionally with the input size.
Example: Iterating through an array → for i in range(n)
Logarithmic Time – O(log n)
7
The runtime grows extremely fast.
Example: Generating all possible permutations of n elements
Factorial Time – O(n!)
The runtime increases proportionally with the input size.
Example: Iterating through an array → for i in range(n)
Exponential Time – O(2^n)
8
Big O Notation
Best Case: The minimum time required for execution.
Average Case: The expected time taken for random input.
Worst Case: The maximum time required (important for analysis).
9
Show answer
Auto Play
Slide 1 / 9
SLIDE
Similar Resources on Wayground
10 questions
Coding in Kindergarten 2023
Presentation
•
KG
10 questions
Criteria and Constraints
Presentation
•
12th Grade
7 questions
2.2 Network Architecture
Presentation
•
12th Grade
8 questions
WINDOWS XP
Presentation
•
12th Grade
8 questions
Radicals and Rational Exponents
Presentation
•
12th Grade
9 questions
ICT 0417 IGCSE CH6 Applications Weather Forecasting
Presentation
•
12th Grade
10 questions
Plessy v. Ferguson
Presentation
•
12th Grade
10 questions
Algebra - Lesson Distance Between Points
Presentation
•
12th Grade
Popular Resources on Wayground
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
Map Skills
Quiz
•
3rd Grade
22 questions
Continents and Oceans
Quiz
•
5th Grade
15 questions
Rounding Decimals
Quiz
•
5th Grade
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
Discover more resources for Computers
16 questions
Module 1 Topic 2 Vocabulary Test
Quiz
•
9th - 12th Grade
30 questions
Python- if -ifelse-elif
Quiz
•
9th - 12th Grade
46 questions
Level 1 Google Sheets Midterm Flashcard
Flashcard
•
9th - 12th Grade
40 questions
Introduction to Microsoft Word
Quiz
•
8th - 12th Grade
20 questions
Job Interview Preparation Quiz
Quiz
•
12th Grade