2.1 Algorithms Flashcards
only keywords (13 cards)
Define Abstraction
Including only the necessary details and leaving out the unnecessary details when problem solving
Define Algorithmic thinking
A way of getting to a solution by identifying the steps needed
Define Decomposition
Breaking a problem down into smaller sub-problems, making the overall problem easier to solve
Define Algorithm
A sequence of steps designed to perform a particular task
Define Flowchart
A method of designing algorithms before coding using symbols
Define Pseudocode
1) Language independent description of the steps of an algorithm.
2) Has no defined syntax, so it cannot be compiled or interpreted by the computer.
Define Binary search
1) Accessing the middle record and determining whether the data item has been found.
If not, checking whether it is before or after the current record in the data set.
2) Discarding the half of the data set that does not contain the record in each pass.
3) Repeating the algorithm until the data item is found or it is not in the data set.
It only works if records in the file are in sequence
Define Bubble sort
1) Repeatedly steps through a data set comparing each pair of adjacent items
2) Swaps pairs of items if they are in the wrong order
3) Stops when no swaps are made
Define Insertion sort
Finds the correct location in a list for an item…
…By comparing it to the other items in the list in a linear way…
…Inserting the new item at the correct position…
…By moving all the other items after it by one index
Define Linear search
Examining each data item in turn until the item is found or the end of the data structure / file is reached
Define Merge sort
1) A divide and conquer algorithm
2) A list is repeatedly divided into smaller lists eventually containing just one item.
3) Each element is compared with the adjacent list…
…And merged back together from two lists into one
Define Syntax errors
Errors that break the grammatical rules of the programming language and prevent it from being run or translated
Define Logic errors
Errors that produce unexpected output/incorrect results but won’t stop the program from running