Fundamentals of Algorithms Flashcards
Define algorithm efficiency
Algorithmic efficiency describes how long it takes to run an algorithm and how much space is needed.
What is the purpose of a trace table?
To show the value of each variable while an algorithm is dry run.
What is meant by language independent?
The algorithm can be written in any programming language.
What is pseudo-code?
An algorithm written out in words.
Why does merge sort reduce lists to one item?
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.
What is a sequence?
A programming construct that determines the order in which instructions are carried out.
Which statements implement indefinite iteration?
REPEAT UNTIL statements
Which statements implement definite iteration?
FOR ENDFOR statements
Which form of INDEFINITE iteration tests the condition at the end of the loop?
REPEAT UNTIL tests the condition at the end of the loop.
Which form of INDEFINITE iteration tests the condition at the start of the loop?
WHILE ENDWHILE tests the condition at the start of the loop.
Which statement will always run the code within it at least once?
The code inside a REPEAT UNTIL loop will be run at least once, even if the condition has been met.
What is the name given to the joining of strings?
Concatenation
What is a subroutine?
A named piece of code that is written outside of the main program.
What is machine code?
A programming language that consists of instructions written in binary.
What is a high-level language?
A programming language close to the programmer’s spoken/written language.