Introduction to algorithms Flashcards

1
Q

What is an algorithm?

A

An algorithm is a specific set of steps of a finite number required to solve a specific problem or provide a solution to said problem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the characteristics or properties of an algorithm?

A

The are various properties that every algorithm requires.
Acronym: FIGED

  1. Finiteness
    ->Every algorithm must have a finite or specific number of steps.
  2. Input/Output
    ->Every algorithm must take in zero or more inputs but must always produce some sort of output.
  3. Generality
    ->Every algorithm must be able to take in every value in its valid set of inputs and produce the required outputs.
  4. Effectiveness
    ->Each step of an algorithm must be easily translatable and applicable to a programming language.
  5. Definiteness
    -> Each step of an algorithm must be clearly and stated, to make them easy to understand and easy to impliment.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the different categories of algorithms/

A
  1. Selective Algorithms:
    -> These are algorithms that involve some sort of decision-making, not every instruction in these algorithms is executed as certain instructions are executed depending on whether or not a particular condition is fulfilled.
  2. Sequential Algorithms
    -> In algorithms of this nature every instruction within them is executed one after another and every instruction is executed once.
  3. Iterative Algorithms
    -> These algorithms contain an instruction or set of instructions that are repeated multiple times.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly