Theory of Computation Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is Backus Naur Form? (BNF)

A

A way of notating context-free languages. It uses statements in which the left hand side is defined by the right hand side

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

Why is finding out if a program will eventually stop if given a particular input significant for computation?

A

It demonstrates that there are some problems that cannot be solved by a computer

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

Time complexity of a binary search algorithm:

A

O(log n)

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

The two measures of time complexity:

A

Space/memory
Describe the complexity of an algorithm

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

What is the halting problem?

A

It is possible in general to write a program that can tell, given any program and its inputs and without running the program whether the given program with its given inputs will halt

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

Significance of the halting problem:

A

It shows that some problems are non-computable

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

Merge sort time complexity:

A

O(n log n)

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

Bubble sort time complexity:

A

O(n^2)

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

Why does bubble sort have that complexity?

A

In each pass through the list n items will be examined. There will be n passes through the list

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

What does it mean if a problem is intractable?

A

The problem can be solved but not in polynomial time

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

How to solve an intractable problem?

A

Use of a heuristic that provides a close-to-optimal solution

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

Why does linear search have time complexity O(n)?

A

As size of the list increases the time taken to search for an item increases
A linear search looks at each item in the list in turn

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