1.3 Introduction to algorithms Flashcards

1
Q

What is an algorithm?

A

An algorithm describes a sequence of steps to solve a computational problem or perform a calculation.

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

What does a computational problem specify?

A

A computational problem specifies an input, a question about the input, and the desired output.

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

What is the input in the FindMax algorithm?

A

An array of integers.

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

What is the output of the FindMax algorithm?

A

The maximum integer in the input array.

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

What question does the FindMax algorithm answer?

A

What is the maximum value in the input array?

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

Fill in the blank: A computational problem is a problem that can be solved using a _______.

A

computer

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

What is the significance of the input in determining the frequency of a word?

A

The input must include a list of all words to search through and the specific word for which determining the frequency is desired.

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

What is the problem output when determining the frequency of a specified word?

A

Integer value for the frequency of specified word.

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

True or False: An algorithm must be written using a programming language.

A

False

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

In which domains can computational problems be found?

A
  • E-commerce
  • Internet technologies
  • Biology
  • Manufacturing
  • Transportation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a common algorithm used for DNA analysis?

A

Longest common substring algorithm.

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

What is the purpose of the binary search algorithm?

A

To search a sorted list efficiently.

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

What does Dijkstra’s shortest path algorithm determine?

A

The shortest path from a start vertex to each vertex in a graph.

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

What is the characteristic of NP-complete problems?

A

No efficient algorithm has been found to solve an NP-complete problem.

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

True or False: If an efficient algorithm exists for one NP-complete problem, all NP-complete problems can be solved efficiently.

A

True

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

What is the clique decision problem?

A

It is a problem to determine if a set of K people who all know each other exists, and it is NP-complete.

17
Q

What is the output of the clique decision problem?

A

Boolean value.

18
Q

True or False: An efficient algorithm exists for all computational problems.

19
Q

True or False: An algorithm with a polynomial runtime is considered efficient.

20
Q

What is the current consensus regarding efficient algorithms for NP-complete problems?

A

Such an algorithm is unlikely to exist.