3.1.2 - Efficiency of algorithms Flashcards

(5 cards)

1
Q

What is an efficient algorithm

A

An algorithm that solves a problem using the least amount of resources, such as time and space

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

Why is algorithm efficiency important

A

Performs tasks faster and using less resources, which is better for large algorithms and reduce costs.

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

How can two algorithms solving the same problem differ in efficiency?

A

One may use less storage or may be more time-efficient by using less steps

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

Example of two algorithms that solve the same problem but may have different efficiencies.

A

Linear search and binary search both solve the problem of finding an item in a list, but binary search is more efficient for sorted lists.

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

The efficiency of an algorithm is affected by:

A

Number of steps needed
Amount of memory or storage used
Type of algorithm used (e.g, linear or binary)

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