Algorithms Flashcards
What is an algorithm?
A sequence of instructions that can be followed to complete a specific task
What is abstraction?
The process of removing unnecessary details from a problem.
What is decomposition?
Breaking down a problem into a number of sub-problems so that each sub-problem accomplishes a specific task.
What is a flow-chart?
A diagram that shows the steps of an algorithm through the use of symbols
What is pseudocode?
A technique of describing an algorithm in a manner that resembles a programming language.
What is a trace table?
Trace tables allow the programmer to trace through a computer program using pen and paper, keeping a record of how variable values change over time.
What is debugging?
The process of finding and fixing errors in a computer program.
What is input?
An input can be generated by a user or a sensor. Computer programs may preform different actions dependant upon different input values.
What is a process?
An action taken by a computer program.
What is an output?
The result of a process in a computer program which may result in a sound, visual or mechanical response.
What is a linear search?
The linear search works by looking at each value of the list in turn until it finds the item its looking for. This linear search is slow but its easy to program and can work with an unordered list.
What is a binary search?
Each iteration the binary search compares the middle value in the list against the value which is being attempted to be found. Half the list is discarded each iteration making the search very fast. The binary search works with ordered lists only.
What is a bubble sort?
The bubble sort takes lists of unordered values and putting them into the correct order by comparing two neighbouring numbers. Each run through the bubble sort is called a pass. The bubble sort is complete when a pass finished without any swaps being made.
What is a merge sort?
The merge sort algorithm repeatedly divides a list into two until all elements are separated individually. Pairs of lists are then compared, placed into order and combined. The process is then repeated until the list is recomplied as a whole. The merge sort is more complex to program than the bubble sort but much faster.
Linear search vs binary search
The linear and binary searching produce the same results but the linear search is best used when the data is not in order or with smaller lists. The binary search is much more efficient when there is an ordered list of values to search.