T6 - MS Flashcards
Decomposition
Breaking a complex problem down into smaller problems
Abstraction
Hiding or removing irrelevant details from a problem to reduce complexity
Input sanitisation
Cleaning up data entered by removing non-standard characters
Casting
Converting one data type to another, for example converting an integer to a real number
Define what is meant by abstraction.
Removing / hiding / obscuring
unnecessary detail
Focusing on the important detail
to reduce complexity
Identify ways that the program has been made more maintainable.
Indentation
Appropriately named variables
Modularisation / use of subroutines
Comments
Use of constants
logic error
An error that results in incorrect output
Contains an error but still runs
syntax error
Contains an error in the language code but will not run
Describe one way that the maintainability of this algorithm could be improved.
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
Give the names of two other sorting algorithms that could be used instead of bubble sort.
insertion
merge
Describe the steps a binary search will follow to look for a number in a sorted list.
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
Describe the steps a linear search would follow when searching for a number that is not in the given list.
Starting with the first value
checking all values in order
State one reason why a binary search would not be able to be used
not sorted
insertion sort
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