Skip to content

Latest commit

 

History

History
41 lines (32 loc) · 1.65 KB

2 - Algorithms.md

File metadata and controls

41 lines (32 loc) · 1.65 KB

Algorithms

Types of Algorithms

Iterative

  • An algorithm that is called repeatedly but for a finite number of times, each time being a single iteration.
  • Often used to move incrementally through a dataset.

Recursive

  • An algorithm that calls itself in its definition.
  • The recursive case in a conditional statement is used to trigger the recursion.
  • The base case in a conditional statement is used to break the recursion.

Greedy

  • An algorithm that follows the problem solving heuristic of making the locally optimal choice at each stage with the hope of finding a global optimum.
  • The general five components, taken from Wikipedia:
    • A candidate set, from which a solution is created.
    • A selection function, which chooses the best candidate to be added to the solution.
    • A feasibility function, which is used to determine if a candidate can be used to contribute to a solution.
    • An objective function, which assigns a value to a solution, or a partial solution.
    • A solution function, which will indicate when we have discovered a complete solution.

Important Algorithms