Fundamentals Of Algorithms Flashcards
What is an algorithm?
A series of instructions that describe how to solve a problem or perform a task
What is decomposition?
Advantages?
Decomposition is breaking a problem down into smaller ‘sub-problems’
Smaller problems are easier to solve than larger problems
Sub-problem can be kept separate making planning and working to timescale
Sub-problems are easier to distribute among a team
What is abstraction?
Hiding the layers of complexity within a system in order to focus on one specific layer of complexity
What is pseudocode?
A cross between English and generic-looking programming language. It does not have an exact language
What is a flowchart?
Defining an algorithm using shapes and arrows. Within each shape, an action is taking place or decision being made
What shapes are used for different commands?
Ellipse — Terminator
Diamond — IF Statement
Rhombus — Decision
Rectangle — Process
What is the efficiency of an algorithm?
Efficiency is a measure to compare 2 different algorithms that solve the same problem. More efficient is dictated by the number of time and space used.
What is a searching algorithm?
What are the 2 types of searching?
Searching is determining whether a piece of data exists within a data structure.
Linear search algorithm begins at 1 end of the data structure and checks each data item till the required item is found.
Binary search algorithm begins in the middle eliminating half of the data with each loop.
What is a sorting algorithm?
What are the two types?
Sorting algorithms put data in order whether in numerical, alphabetical, or chronological order.
Bubble///Merge Sorting
How do linear and binary search compare to each other?
Linear search can function on unsorted data whereas a binary search cannot
Linear search is more time consuming than a binary search
How to bubble and merge sort compare to each other?
Bubble sort is much more straightforward to program.
Merge sort requires lots more memory when it runs
Merge sort is much more efficient in terms of time