Algorithms Flashcards
Define: Graph - Depth First Traversal
Explores down an entire branch before moving on. Uses a stack.
Define: Graph - Breadth First Traversal
Explores a whole level before moving down instead of using branches. Uses a queue.
Define: Recursive algorithm
A function which calls itself
What are the three essential characteristics of a recursive routine?
1) A base case must be included, when met means that the routine will not call itself and will start to “unwind”.
2) The stopping condition must be reached after a finite number of calls.
3) The algorithm must modify something that moves it towards the base case.
Define: Big-O Notation
Is a measure of the time complexity of an algorithm. It is a useful approximation to the actual number of steps in a computation
Define: Linear Search
Starts at beginning and continues until found or end. O(n).
Define: Binary Search
Goes to middle, then keeps splitting list in half until found/not found. Only works on ordered list. O(log2n).
Define: Tractable Problems
Problems that have a polynomial (or less) time solution are called tractable problems.
Define: Intractable Problems
Problems that have no polynomial (or less) time solution are called intractable problems.
Define: Heuristic Approach
Is one which tries to find a solution which may not be perfect but which is adequate for its purpose. A heuristic approach makes an ‘educated guess’ and uses common sense.
Define: Halting problem
Provides a definition for a non-computable problem.