Definitions Flashcards

1
Q

What is an algorithm?

A

A sequence of unambiguous instructions for solving a problem (obtaining a required output
for any legitimate input in a finite amount of time)

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

What is a Set?

A

A collection of elements.
Usually containing no repetitions, and in no particular order

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

What is the result of a union (∪) of these two sets?
T1 = {1,3,4,6}
T2 = {1,2,6,7}

A

T1 ∪ T2 = {1,2,3,4,6,7}
“The set of elements present in either set”

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

What is the result of an Intersection (∩) of these two sets?
T1 = {1,3,4,6}
T2 = {1,2,6,7}

A

T1 ∩ T2 = {1,6}
“The set of elements appearing in both sets”

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

How do you represent an empty set?

A

∅ = A set with no elements

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

What is a subset(⊂)?

A

A set where every element in the subset is present in the superset.
R1 = {1,3} is a subset of R2 = {1,2,3,4,5}

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

What are Undecidable Problems?

A

A problem for which there exists no algorithm capable of solving all instances of the problem in a finite amount of time

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

What is an NP problem?

A

A problem that can be solved in polynomial type using a non-deterministic algorithm

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

What is a P problem?

A

A problem that can be solved in polynomial time (e.g n or n2)

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

What is a Non-deterministic Algorithm?

A

An algorithm that will make guesses as it proceeds.

It will then check it’s answer later to see if the guess was right?

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

What is pseudocode?

A

A mixture of natural and programming languages
Used to describe an algorithm

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

What do these mean in pseudocode?
1. x ← 0
2. if n > 0 then
3. for k ← 1 to n do
4. // Input or Output

A
  1. Value assignment
  2. If statement
  3. Iteration
  4. Comment
How well did you know this?
1
Not at all
2
3
4
5
Perfectly