T6 - MS Flashcards

1
Q

Decomposition

A

Breaking a complex problem down into smaller problems

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

Abstraction

A

Hiding or removing irrelevant details from a problem to reduce complexity

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

Input sanitisation

A

Cleaning up data entered by removing non-standard characters

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

Casting

A

Converting one data type to another, for example converting an integer to a real number

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

Define what is meant by abstraction.

A

Removing / hiding / obscuring
unnecessary detail

Focusing on the important detail

to reduce complexity

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

Identify ways that the program has been made more maintainable.

A

Indentation
Appropriately named variables
Modularisation / use of subroutines
Comments
Use of constants

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

logic error

A

An error that results in incorrect output

Contains an error but still runs

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

syntax error

A

Contains an error in the language code but will not run

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

Describe one way that the maintainability of this algorithm could be improved.

A

Comments
… to enable programmers to
understand the purpose of each line

Naming variables sensibly
… to enable programmers to
understand the purpose of each
variable

Modularise
…to allow reuse / makes easier to test
/ reduces errors

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

Give the names of two other sorting algorithms that could be used instead of bubble sort.

A

insertion
merge

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

Describe the steps a binary search will follow to look for a number in a sorted list.

A

Select middle number

…check if selected number
matches target number (not just
compare)

…if searched number is larger, discard
left half // if searched number is
smaller, discard right half

Repeat until number found

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

Describe the steps a linear search would follow when searching for a number that is not in the given list.

A

Starting with the first value
checking all values in order

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

State one reason why a binary search would not be able to be used

A

not sorted

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

insertion sort

A

The list of
words is initially
split into a
sorted set and
an unsorted set

Each word is
inserted into the
correct place in
the array, one
by one

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