What is an Algorithm? Flashcards

1
Q

What is an algorithm?

A

An algorithm is a set of commands that must be followed for a computer to perform calculations or other problem-solving operations.

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

Define the term ‘Problem’ in the context of algorithms.

A

A problem can be defined as a real-world problem or real-world instance problem for which you need to develop a program or set of instructions.

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

What are the main components of an algorithm?

A
  • Input
  • Processing
  • Output
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do algorithms work?

A

Algorithms take input data, process it through logical and mathematical operations, and produce an output.

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

What is meant by the efficiency of an algorithm?

A

Efficiency refers to the algorithm’s ability to accomplish tasks quickly and with minimal resources.

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

What is the role of optimization in algorithm design?

A

Algorithm designers seek ways to optimize their algorithms, making them faster and more reliable.

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

List some significant applications of algorithms.

A
  • Data Analysis and Machine Learning
  • Cryptography & Security
  • Information Retrieval and Search Engines
  • Optimization Problems
  • Genomics and Medical Diagnostics
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the characteristic of finiteness in an algorithm?

A

An algorithm must always have a finite number of steps before it ends.

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

What does definiteness mean in the context of algorithms?

A

An algorithm needs to have exact definitions for each step to ensure clear directions.

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

What is meant by the ‘Input’ of an algorithm?

A

Inputs are one or more values supplied to the algorithm before its processing.

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

What is the expected outcome of an algorithm referred to as?

A

The output.

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

What is the effectiveness of an algorithm?

A

Each stage of an algorithm must be straightforward and achievable within finite time using basic operations.

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

What does generality refer to in algorithms?

A

An algorithm should be able to solve a group of issues rather than being limited to a single particular case.

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

What does it mean for an algorithm to be cross-language compatible?

A

The algorithm must have small and simple instructions that can be implemented in any programming language.

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

True or False: An algorithm can have an infinite number of steps.

A

False

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

Fill in the blank: An algorithm must produce one or more _______.

A

outputs

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

What is a Brute Force Algorithm?

A

A straightforward approach that exhaustively tries all possible solutions.

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

What is a Recursive Algorithm?

A

A method that breaks a problem into smaller, similar subproblems and repeatedly applies itself to solve them.

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

What is an Encryption Algorithm used for?

A

To transform data into a secure, unreadable form using cryptographic techniques.

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

What is a Backtracking Algorithm?

A

A trial-and-error technique used to explore potential solutions by undoing choices when they lead to an incorrect outcome.

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

What is a Searching Algorithm designed to do?

A

Find a specific target within a dataset.

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

What is the purpose of a Sorting Algorithm?

A

To arrange elements in a specific order.

23
Q

What does a Hashing Algorithm do?

A

Converts data into a fixed-size hash value for rapid data access.

24
Q

What is a Divide and Conquer Algorithm?

A

Breaks a complex problem into smaller subproblems and combines their solutions.

25
Q

What is a Greedy Algorithm?

A

Makes locally optimal choices at each step to find a global optimum.

26
Q

What is a Dynamic Programming Algorithm?

A

Stores and reuses intermediate results to avoid redundant computations.

27
Q

What is a Randomized Algorithm?

A

Utilizes randomness in its steps to achieve a solution.

28
Q

What are the essential pre-steps before writing an algorithm?

A
  • Clear problem definition
  • Consider constraints
  • Understand input required
  • Define expected output
  • Ensure solution fits constraints
29
Q

What is the purpose of analyzing an algorithm?

A

To assess its relevance for different applications or compare it to other algorithms.

30
Q

What is a Linear Search Algorithm?

A

An algorithm that finds if a specific item exists in a list by comparing each item.

31
Q

What steps does a Bubble Sort Algorithm include?

A
  • Compare adjacent numbers
  • Swap them if in wrong order
  • Repeat until no swaps needed
32
Q

How do you calculate the factorial of a number using an algorithm?

A

Multiply a variable by each integer from 1 to n.

33
Q

What is the Euclidean Algorithm used for?

A

Finding the Greatest Common Divisor (GCD) of two numbers.

34
Q

What is an algorithm?

A

A process or set of rules to be followed in calculations or other problem-solving operations.

Algorithms are fundamental in computer science for automating tasks.

35
Q

What is the output of an algorithm?

A

The algorithm’s outcome after every step has been completed.

Outputs should be clearly related to the input.

36
Q

Define effectiveness in the context of algorithms.

A

Stages must be straightforward to carry out in finite time using basic operations.

Every operation should be doable and practicable.

37
Q

What does generality mean for an algorithm?

A

An algorithm should be able to solve a group of issues rather than being limited to a single case.

It offers a generic fix for various inputs.

38
Q

What is feasibility in algorithm design?

A

Indicates that an algorithm is practical and can be implemented with available resources.

An algorithm should require minimal changes when redefined.

39
Q

What is time complexity?

A

Measures the amount of time an algorithm takes to complete as a function of the size of its input.

Helps analyze efficiency and predict runtime growth.

40
Q

Define space complexity.

A

Measures the amount of memory an algorithm uses as a function of the size of its input.

Includes memory for input, output, and auxiliary variables.

41
Q

What does it mean for an algorithm to be independent?

A

Relies only on logical constructs and is language-independent.

A simple algorithm is easier to understand.

42
Q

What is parallel computing in algorithms?

A

Divides tasks into smaller sub-tasks for parallel execution on multiple processors.

Improves performance and reduces execution time.

43
Q

What does performance measure in an algorithm?

A

How well the algorithm works, including its correctness and efficiency.

Correctness indicates that inputs produce the desired output.

44
Q

What are processing steps in an algorithm?

A

The sequence of steps in the algorithm, also referred to as modularity.

Breaking down problems into small modules enhances clarity.

45
Q

What does ‘unambiguous’ mean in the context of algorithms?

A

Each step in the algorithm is clear and has one meaning.

This defines an algorithm’s robustness.

46
Q

How can algorithms be represented?

A

Through natural language, flow charts, pseudocode, and programming languages.

Each method has its advantages and disadvantages.

47
Q

List the qualities of a good algorithm.

A
  • Efficiency
  • Correctness
  • Clarity
  • Scalability
  • Reliability
  • Optimality
  • Robustness
  • Adaptability
  • Simplicity

These qualities ensure effective algorithm performance.

48
Q

What is the big O notation used for?

A

To represent an algorithm’s time complexity and space complexity.

It helps in analyzing the performance of algorithms.

49
Q

What are the advantages of algorithms?

A
  • Efficiency
  • Reproducibility
  • Problem-solving
  • Scalability
  • Automation

They streamline processes and enhance productivity.

50
Q

What are the disadvantages of algorithms?

A
  • Complexity
  • Limitations
  • Resource Intensive
  • Inaccuracy
  • Maintenance

Developing algorithms can be challenging and requires ongoing updates.

51
Q

Why is it called an algorithm?

A

The term comes from the Medieval Latin term algorism, referring to rules for arithmetic using the Hindu-Arabic numeral system.

The term evolved to represent systematic problem-solving methods.

52
Q

Who is considered the father of algorithms?

A

Muhammad ibn Musa Al-Khwarizmi, a 9th-century Muslim scientist.

He invented algorithms and algebra.

53
Q

What does the theory of algorithms involve?

A

It involves the structure and complexity of algorithms, including metric and descriptive theories.

Metric theory focuses on complexity, while descriptive theory on input-output correspondence.