2021/22 past paper Flashcards

(15 cards)

1
Q

Which statement is NOT true about Pseudo-Code?
a) Can only represent certain algorithms
b) Language-independent
c) Mix of English + formal notation
d) Can compute computational complexity
e) All others correct

A

a) Pseudo-Code can represent ANY algorithm

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

What is a primitive operation?
a) Steps to solve a problem
b) Basic computation (e.g. addition)
c) Single line of Java code
d) Anything in a flowchart
e) All correct

A

b) Basic computation

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

Algorithm has T(n) = 13 + 55n⁴ + 3n² + 7n. Big-O is:
a) O(n)
b) O(n⁷)
c) O(n²)
d) O(13)
e) none

A

e) None → Correct Big-O is O(n⁴) (highest term dominates)

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

Which sorting algorithm has best-case O(n log n)?
a) Radix
b) Monkey
c) Quick
d) Bubble
e) None

A

c) Quick Sort (best/average case is O(n log n); worst is O( n² ))

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

Which sorting algorithm has worst-case O(n log n)?
a) Radix
b) Monkey
c) Quick
d) Bubble
e) None

A

e) None -> Merge Sort and Heap Sort have O( n log n) worst-case

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

What is NOT part of Quick Sort?
a) Numeric input
b) Recursion
c) PivotTable
d) Input graph
e) All are part

A

d) Input graph -> Quick Sort uses array/lists, not graphs

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

A Queue is known as:
a) LIFO
b) FIFO
c) FIDO
d) FILO

A

b) FIFO

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

A Hash Table:
a) Has ENQEUE/DEQUEUE
b) Use in all algorithms
c) Maps key to value
d) Used in all sorting

A

c) Maps key to value

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

OneMax fitness of 11000011
a) 8
b) 27
c) 95
d) 4

A

d) 4 -> count of 1s (bits 1,2,7,8)

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

Small change to 11000011 could yield:
a) 11000010
b) 11000000
c) 10000001
d) 11111111

A

a) 11000010 -> flips one bit (e.g. last one)

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

Issue with Tablu-Search Problem
a) Tablu list grows
b) Many runtime parameters
c) Large iterations
d) No global optimum guarantee

A

e) All correct -> common issues in metaheuristics

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

Which are nature-inspired?
a) Particle Swarm
b) Evolutionary Programming
c) Genetic Algorithms
d) All

A

d) All

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

GA heuristic
a) Stigmergy
b) Cooling rate
c) Hill climbing
d) Crossover

A

d) Crossover -> combines parent solutions

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

ILS builds solutions by:
a) Population + selection
b) Simulating insects
c) Forbidding past moves
d) Perturbing local minima

A

d) Perturbing local minima 0 -> escape local optima

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

Not a GA parameter?
a) Number of bits
b) Generations
c) Population size
d) Mutation probability
e) All

A

e) All are parameters

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