1.1 Algorithms
No description yet. This curated deck is ready for daily study.
Card preview (9)
What are Algorithms?
• Algorithms are a sequence of instructions that perform a certain task. • They are completely independent and can be implemented
What is Pseudocode?
Programmable code written in standard english for easier understanding.
What is a Flowchart?
Flowcharts also represent data flow, but the shapes have different meanings. The oval → Start/End The Square → Process The Rhombus → Decision The Parallelogram → Inputs/Outputs The Lined Rectangle → Subroutines
What is a Linear Search?
• A linear search checks each element until a match is found, or until the whole list has been checked. • Uses Brute Force.
What is Binary Search?
• Binary search is done by dividing a list into two and eliminating the half not containing the targeted element. • The list must also be ordered. • Works by simplification.
How is a Binary Search conducted?
• Find the Midpoint • Eliminate Unneeded half • Repeat Until found
What is a Bubble Sort?
• A bubble sort orders an unordered list • It does so by making comparisons to adjacent elements and swapping them, largest value to the back • Each comparison to the full data set is a pass
What is a Merge Sort?
• Divide and Conquer and Merge: • The list is first divided into two, keeps splitting until there is one element left • Sorts the list recursilvely • Merge the lists from the single elements
When should Linear/Binary Search be used?
• Linear Search should be used in unordered lists, whilst binary searches require ordered lists.