Zusammenfassung der Ressource
Unit 2.1 Algorithms
- Key Word Bank
- Sorting - Arranging the elements in a list
or collection in increasing or decreaing
order of a particular property.
- Abstraction - Using symbols, variables etc. to
represent a 'real world' problem in a computer
program, and removing unnecessary elements
- Decompostion - The breaking down of large
problems into smaller, easier to solve ones which
can be combined to make the full solution.
- Algorithmic Thinking - Identifying the
steps involved in solving a problem.
- Binary Search
- Put the list in order
- Take the middle value
- Is it the value you want?
- ELIF it is larger take the
list of values to the left.
- ELIF it is smaller take the
list of values to the right.
- Repeat until you get
the desired value.
- Linear Search
- Check the first value
- If it is the wanted value then stop
- ELIF, Check the next value
- Repeat until all have
been checked.
- Bubble Sort
- Take the first and
second elements.
- Compare Them.
- If Element 1 > 2, Swap them.
- ELSE, Do Nothing
- Do this until you can go all the way through
without making any changes.
- Merging Lists
- Repeat until merged.
- Split all elements
into individual lists
- Compare the first
element in both lists.
- Put the smallest
in a new list
- Compare the next of 1
list with the second of
the second list
- Put the smallest in a new list.
- Merge Sort
- Split a list into individual lists, of one element each
- Merge the lists in pairs putting the smallest first
- Merge until it is all in order
- Insertion Sort
- Element 1 is a 'sorted' list
- The rest are 'unsorted' list
- Compare the unsorted element
to each element in the sorted list
- If it is smaller, put it in
front of that element
- ELIF it is larger, compare
with next value
- If there are no more
elements to compare with,
put it in the final position
- Repeat until all
elements are
'sorted'
- Flowcharts
- They are used
to represent
algorithms
- Shows the data that is
input and output
- Shows the processes taking place
- Shows the decisions
and repetitions
- Lines/Arrows show
the flow of control
- Set Shapes are used; Start/End is an oval, INPUT/OUTPUT is a
parallelogram, Processes are rectangles, and Decisions are diamonds
with Yes/No answers coming off on different branches