Algorithms/Pseudocode Flashcards

1
Q

What is a SEQUENCE?

A

A SEQUENCE is a simple list (in order) of steps

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

What is a WHILE?

A

A WHILE is conditional – while a condition is true, the steps are run. A simple test at the start of each iteration.

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

What is a IF-THEN-ELSE?

A

A IF-THEN-ELSE is a decision – something is tested and one of 2 possible responses are run. These can be nested to create multiple levels.

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

What is a REPEAT-UNTIL?

A

A REPEAT-UNTIL is a loop which runs a test at the end of each iteration

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

What is a FOR?

A

A FOR is for counting loops

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

What is a CASE?

A

A CASE is for selecting from several options

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

What are the different structures?

A

o Repetition – loops, repeats
o Sequence – several unconnected steps in order (same as pseudocode)
o Recursion – problem solved by solving smaller versions of itself eg nested if
o Selection – choosing path based on value test

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

What will the size of a file affect?

A

The bigger files will usually result in longer times to open, find things etc

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

What are the choices of storage medium constrained by?

A

cost, storage capacity, robustness, portability and compatibility between systems

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

What is the difference between Selection Sorting and Quick Sorting?

A

In a Selection Sort, the list is sorted into 2 sections. Each value is checked from the start to the end to find the smallest value (or largest if sorting descending). When found, this item is placed at the front of the list and is no longer compared. The rest of the list is then checked for the next smallest value. In a Quick Sort, a mid point is selected and all values less than this move to the left, higher to the right. New midpoints are chosen; smaller selections each time. Much faster

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

What is the difference between a Linear Search and a Binary Search?

A

A Linear Search refers to reading a file from start to end looking for required record (N.T. records do not need to be in order). A Binary Search refers to picking a midpoint and if the value being searched is less than the midpoint, the upper half is discarded. A new midpoint is selected and the process is repeated until the record is found.

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