1 Fundamentals of algorithms Flashcards

1
Q

define algorithm

A

a series of instructions that can perform or execute a specific task

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

define decomposition

A

a technique where you take a problem and you break it down into smaller parts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

define abstraction

A

a technique where you take out unnecessary or extra parts of a problem to make it easier

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is the formula for calculating file size?

A

File size(bytes) = Sample rate * Sample Resolution * time (in seconds) / 8

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is the formula for calculating total bytes for a bitmap image?

A

Total number of bytes for a bitmap image (file size) = colour depth x width x height / 8

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

State 2 effects of increasing the number of pixels the image is made up of

A

1) You can zoom into the picture more before it becomes pixelated
2) it would increase the file size

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

how are sound waves converted and stored in a computer?

A

A microphone/sound sensor picks up the sound wave

The wave is converted to an analogue signal

The amplitude/height is measured

These measurements are called samples and take place at regular intervals

These samples are stored as binary values in the computer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what will happen if u increase the sample rate?

A

the file will be truer to its original sound, the file quality will increase.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

how do you calculate bit rate in sound?

A

Bit rate = sample rate x bit depth

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what 3 factors can affect the size of a sound file?

A

duration, sample rate, and bit depth

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what is the pseudocode for converting from denary to binary?

A

Output(“What number do you want to convert?”)
numberD <– USERINPUT
While numberD <> 0 do
Repeat
numberD / 2
Until numberD = 0
Repeat
Remainder <– NumberD MOD 2
Until numberD = 0
End while

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what is binary shift left basically?

A

multiplying by powers of two

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what is binary shift right basically?

A

dividing by powers of two

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

State the arithmetic effect of applying a left binary shift of 6 followed by a right binary shift of 8 on a binary number

A

The number would be divided by 2^2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

State the arithmetic effect of applying a left binary shift of four on a binary number

A

Multiplying it by 2, 4 times/ Multiply by 2^4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly