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
  • Optimization Problems
  • Genomics and Medical Diagnostics
  • Information Retrieval and Search Engines
  • Cryptography & Security
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
What is a Greedy Algorithm?
Makes locally optimal choices at each step to find a global optimum.
26
What is a Dynamic Programming Algorithm?
Stores and reuses intermediate results to avoid redundant computations.
27
What is a Randomized Algorithm?
Utilizes randomness in its steps to achieve a solution.
28
What are the essential pre-steps before writing an algorithm?
* Clear problem definition * Consider constraints * Understand input required * Define expected output * Ensure solution fits constraints
29
What is the purpose of analyzing an algorithm?
To assess its relevance for different applications or compare it to other algorithms.
30
What is a Linear Search Algorithm?
An algorithm that finds if a specific item exists in a list by comparing each item.
31
What steps does a Bubble Sort Algorithm include?
* Compare adjacent numbers * Swap them if in wrong order * Repeat until no swaps needed
32
How do you calculate the factorial of a number using an algorithm?
Multiply a variable by each integer from 1 to n.
33
What is the Euclidean Algorithm used for?
Finding the Greatest Common Divisor (GCD) of two numbers.
34
What is an algorithm?
A process or set of rules to be followed in calculations or other problem-solving operations. ## Footnote Algorithms are fundamental in computer science for automating tasks.
35
What is the output of an algorithm?
The algorithm's outcome after every step has been completed. ## Footnote Outputs should be clearly related to the input.
36
Define effectiveness in the context of algorithms.
Stages must be straightforward to carry out in finite time using basic operations. ## Footnote Every operation should be doable and practicable.
37
What does generality mean for an algorithm?
An algorithm should be able to solve a group of issues rather than being limited to a single case. ## Footnote It offers a generic fix for various inputs.
38
What is feasibility in algorithm design?
Indicates that an algorithm is practical and can be implemented with available resources. ## Footnote An algorithm should require minimal changes when redefined.
39
What is time complexity?
Measures the amount of time an algorithm takes to complete as a function of the size of its input. ## Footnote Helps analyze efficiency and predict runtime growth.
40
Define space complexity.
Measures the amount of memory an algorithm uses as a function of the size of its input. ## Footnote Includes memory for input, output, and auxiliary variables.
41
What does it mean for an algorithm to be independent?
Relies only on logical constructs and is language-independent. ## Footnote A simple algorithm is easier to understand.
42
What is parallel computing in algorithms?
Divides tasks into smaller sub-tasks for parallel execution on multiple processors. ## Footnote Improves performance and reduces execution time.
43
What does performance measure in an algorithm?
How well the algorithm works, including its correctness and efficiency. ## Footnote Correctness indicates that inputs produce the desired output.
44
What are processing steps in an algorithm?
The sequence of steps in the algorithm, also referred to as modularity. ## Footnote Breaking down problems into small modules enhances clarity.
45
What does 'unambiguous' mean in the context of algorithms?
Each step in the algorithm is clear and has one meaning. ## Footnote This defines an algorithm's robustness.
46
How can algorithms be represented?
Through natural language, flow charts, pseudocode, and programming languages. ## Footnote Each method has its advantages and disadvantages.
47
List the qualities of a good algorithm.
* Efficiency * Correctness * Clarity * Scalability * Reliability * Optimality * Robustness * Adaptability * Simplicity ## Footnote These qualities ensure effective algorithm performance.
48
What is the big O notation used for?
To represent an algorithm's time complexity and space complexity. ## Footnote It helps in analyzing the performance of algorithms.
49
What are the advantages of algorithms?
* Efficiency * Reproducibility * Problem-solving * Scalability * Automation ## Footnote They streamline processes and enhance productivity.
50
What are the disadvantages of algorithms?
* Complexity * Limitations * Resource Intensive * Inaccuracy * Maintenance ## Footnote Developing algorithms can be challenging and requires ongoing updates.
51
Why is it called an algorithm?
The term comes from the Medieval Latin term algorism, referring to rules for arithmetic using the Hindu-Arabic numeral system. ## Footnote The term evolved to represent systematic problem-solving methods.
52
Who is considered the father of algorithms?
Muhammad ibn Musa Al-Khwarizmi, a 9th-century Muslim scientist. ## Footnote He invented algorithms and algebra.
53
What does the theory of algorithms involve?
It involves the structure and complexity of algorithms, including metric and descriptive theories. ## Footnote Metric theory focuses on complexity, while descriptive theory on input-output correspondence.