2.3.1 BIG O NOTATIONS STIFDF

21 flashcardspar Sabs2023
Réviser ces flashcardsGratuit · répétition espacée · iPhone, Android, Mac et web

Toutes les cartes

1
What should you always think abt when developing an algorithm
Space complexity
Time complexity
2
Time complexity?
Indicates how much time an algorithm takes to solve a problem
3
Space complexity
Indicates how much memory the algorithm uses
4
Big o notation?
Expresses complexity of algorithm and considers worst case scenario
- Remove all terms except one with largest factor/exponent
- Remove any constants
5
Simplify this complexity: 5 +3n + 1
3n then n
6
Worst case scenario
When we happen to choose the input which requires the most time
7
Con_?
Constant complexity = O(1) = No matter how big/small the list/input size is, it takes the same amount of time
BEST
8
Lin_?
Linear complexity = O(N) = As list/input size increases , time taken increases proportionally
Okay/mid
9
Log_?
Logarithmic complexity = O(log N) = As input size/list increases, time taken increases at slower rates
Great
10
Pol_?
Polynomial/quadratic =O(N$^{2}$) = As list/input size increases, time taken increases proportionally to the square of list/input size
Not great
11
Ex_?
Exponential = O(2$^{N}$) =Each extra input added(from 2 to 3 etc), DOUBLES time taken
WORST
12
From best to worst sort the complexities out
BEST:
CONSTANT
LOGARITHMIC
LINEAR
POLYNOMIAL/QUADRATIC

EXPONENTIAL
WORST
13
Calculate these functions complexity and then calculate its actual complexity
O(1) + O(n) + O(n^2) + O(1)
Becomes O(n^2)
14
Bubble sort and insertion average and worst time complexity?
Polynomial = O(N$^2$) = for both
15
Merge sort average and worst time complexity
Linearithmic = O(n log N)
16
Quick sort average and worst time complixity
Average = Linearithmic
WORST = Polynomial = O(N$^2$)
17
Occultation d’image : retrouve les étiquettes masquées
18
Linear search average and worst?
Linear = O(N) = for both
19
Binary search array average and worst?
Logarithmic = O(log N) = for both
20
Hashing average and worst?
Average = constant = O(1)
WORST = Linear = O(N) considers overflow list
21
Occultation d’image : retrouve les étiquettes masquées
Réviser les 21 cartes gratuitement

Plus de flashcards : Informatique

Intro to IT 66 cartesInformatique · AnglaisSamData Structures Final Review - GRAPHS ONLY54 cartesInformatique · AnglaisHariProgramming Languages Test 145 cartesInformatique · AnglaisTemplesignals midterm drei yu39 cartesInformatique · AnglaisDiandreiCore Technical Principles 20%33 cartesInformatique · AnglaisNickChapter 5: System Software27 cartesInformatique · Anglais—Griffith—Lesson 3.2 Joining Spatial and Non-Spatial Data21 cartesInformatique · AnglaisDekanoJava Exam217 cartesInformatique · AnglaisCornyUser Interfaces11 cartesInformatique · Anglais—Griffith—Software Architecture and Quality Attributes (Wk3)209 cartesInformatique · AnglaisSamChapter 6: TCP/IP Basics124 cartesInformatique · AnglaisManethelAssembly Language and 8086 Registers Midterm84 cartesInformatique · AnglaisDiandrei

Tous les decks : Informatique

Révise ces decks dans l’app

Gratuit sur iPhone, Android, Mac et le web. Ajoute n’importe quel deck à ton compte en un tap.

Télécharger dans l’App StoreDisponible sur Google Play
Réviser les 21 cartes gratuitement