COMP 2 Flashcards

1
Q

Algorithm?

A

sequence of steps that can be followed to complete a task

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

Algorithms are represented by

A

pseudo-codes and flowcharts

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

Flowcharts

A

I/O
Start/End
Sub-Programme
Choice
Process

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

Algorithms are a________

A

Abstract - meaning it removed unnecessary details from the problem

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

Decomposition?

A

breaking a problem into smaller sub-problems which each represent a different task

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

Trace tables ?

A

shows how values change when an algorithm is carried out

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

bubble sort

A

goes through pairs in one pass and swaps if needs to . repeats until single pass happens with no swaps

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

merge sort

A

divided list continuously by 2 until each list has one item . then it combines two lists at a time in order

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

interger, real, boolean

A

interger - a whole number
float - decimal
boolean - true or false

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

character
string?

A

character - a letter , number or symbol
string - a group of characters

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

multiplication
exponentation (power of)
division
quotient (integer division)
modulus (remainder of quotient)

A

multiplication - *
exponentation - ^
division - /
quotient - DIV
modulus - MOD

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

bolean : NOT , AND , OR

A

NOT - opposite
AND - both sides needed
OR - only one side needed

e.g
if age < 40 AND name != “AJ”
if age < 40 OR name != “AJ”

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

string handling

A

SubString - .substring(start . howMany)
Concatenation - +

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

variables and constants

A

variables are identifiers that hold a value that can be changed
constant are identifiers that hold a value that cannot be changed

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

3 fundamental programming constructs

A

sequence
selection
iteration

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