CS basics Flashcards
What does big O notation do?
Describe performance of an algorithm, meaning the cost in relation to input
Big O O(1)
Constant time (eg printing the first item in array)
Big O O(n)
Linear time - grows 1:1 with growth of input (eg printing all items in array)
Big O O(n2)
Quadratic time (eg nested loops)
Big O O(log n)
Logaritmic time (binary search, very scaleable)
Big O O(2n)
Exponential time (avoid at all cost)
Arity
Antal argument i en funktion
Interpreters translate…
Line by line
Compilers translate…
All lines and execute the whole program
Vad är HMR (Hot Module Replacement) ?
En funktion som tillåter snabbare iterationer genom att ersätta, lägga till eller ta bort moduler i en applikation utan att behöva ladda om hela sidan eller förlora tillstånd.
What does ‘binary’ mean?
‘Of two states’ eg on/off or 1/0
How big is one binary number?
1 bit
How many values can be represented with 8-bit numbers?
0 -255 (256)
How big is 8 bits?
1 byte
How many values can be represented with 32 bits?
Just under 4.3 billion
How are numbers used to represent letters in binary?
UTF (8 or 16)
Where do computers calculate?
In the ALU
ALU
Arithmetic and Logic Unit
UTF
Unicode Transformation Format
How are values stored in memory?
Registers & RAM
RAM
Random Access Memory
How long does a value stay in RAM?
As long as the power stays on (or it isn’t needed anymore)