2.3.1 BIG O NOTATIONS STIFDF

21 Karteikartenvon Sabs2023
Diese Karteikarten lernenKostenlos · Spaced Repetition · iPhone, Android, Mac & Web

Alle Karten

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
Bildverdeckung: nenne die verdeckten Beschriftungen
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
Bildverdeckung: nenne die verdeckten Beschriftungen
Alle 21 Karten kostenlos lernen

Mehr Karteikarten: Informatik

Intro to IT 66 KartenInformatik · EnglischSamData Structures Final Review - GRAPHS ONLY54 KartenInformatik · EnglischHariProgramming Languages Test 145 KartenInformatik · EnglischTemplesignals midterm drei yu39 KartenInformatik · EnglischDiandreiCore Technical Principles 20%33 KartenInformatik · EnglischNickChapter 5: System Software27 KartenInformatik · Englisch—Griffith—Lesson 3.2 Joining Spatial and Non-Spatial Data21 KartenInformatik · EnglischDekanoJava Exam217 KartenInformatik · EnglischCornyUser Interfaces11 KartenInformatik · Englisch—Griffith—Software Architecture and Quality Attributes (Wk3)209 KartenInformatik · EnglischSamChapter 6: TCP/IP Basics124 KartenInformatik · EnglischManethelAssembly Language and 8086 Registers Midterm84 KartenInformatik · EnglischDiandrei

Alle Decks: Informatik

Lerne diese Decks in der App

Kostenlos auf iPhone, Android, Mac und im Web. Füge jedes Deck mit einem Tipp zu deinem Konto hinzu.

Laden im App StoreJetzt bei Google Play
Alle 21 Karten kostenlos lernen