Fundamentals of Algorithms Flashcards

1
Q

Define algorithm efficiency

A

Algorithmic efficiency describes how long it takes to run an algorithm and how much space is needed.

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

What is the purpose of a trace table?

A

To show the value of each variable while an algorithm is dry run.

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

What is meant by language independent?

A

The algorithm can be written in any programming language.

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

What is pseudo-code?

A

An algorithm written out in words.

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

Why does merge sort reduce lists to one item?

A

A list of one item will always be in the right order. This makes sure the separate lists are in order before merging back together.

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

What is a sequence?

A

A programming construct that determines the order in which instructions are carried out.

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

Which statements implement indefinite iteration?

A

REPEAT UNTIL statements

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

Which statements implement definite iteration?

A

FOR ENDFOR statements

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

Which form of INDEFINITE iteration tests the condition at the end of the loop?

A

REPEAT UNTIL tests the condition at the end of the loop.

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

Which form of INDEFINITE iteration tests the condition at the start of the loop?

A

WHILE ENDWHILE tests the condition at the start of the loop.

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

Which statement will always run the code within it at least once?

A

The code inside a REPEAT UNTIL loop will be run at least once, even if the condition has been met.

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

What is the name given to the joining of strings?

A

Concatenation

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

What is a subroutine?

A

A named piece of code that is written outside of the main program.

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

What is machine code?

A

A programming language that consists of instructions written in binary.

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

What is a high-level language?

A

A programming language close to the programmer’s spoken/written language.

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

What is a low-level language?

A

A programming language close to the computer’s instruction set.

17
Q

What is an instruction set?

A

The set of instructions a processor understands.

18
Q

What is a record?

A

A data structure that allows for multiple variables of differing individual types to be held within it.