2021/22 past paper Flashcards
(15 cards)
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) Pseudo-Code can represent ANY algorithm
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
b) Basic computation
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
e) None → Correct Big-O is O(n⁴) (highest term dominates)
Which sorting algorithm has best-case O(n log n)?
a) Radix
b) Monkey
c) Quick
d) Bubble
e) None
c) Quick Sort (best/average case is O(n log n); worst is O( n² ))
Which sorting algorithm has worst-case O(n log n)?
a) Radix
b) Monkey
c) Quick
d) Bubble
e) None
e) None -> Merge Sort and Heap Sort have O( n log n) worst-case
What is NOT part of Quick Sort?
a) Numeric input
b) Recursion
c) PivotTable
d) Input graph
e) All are part
d) Input graph -> Quick Sort uses array/lists, not graphs
A Queue is known as:
a) LIFO
b) FIFO
c) FIDO
d) FILO
b) FIFO
A Hash Table:
a) Has ENQEUE/DEQUEUE
b) Use in all algorithms
c) Maps key to value
d) Used in all sorting
c) Maps key to value
OneMax fitness of 11000011
a) 8
b) 27
c) 95
d) 4
d) 4 -> count of 1s (bits 1,2,7,8)
Small change to 11000011 could yield:
a) 11000010
b) 11000000
c) 10000001
d) 11111111
a) 11000010 -> flips one bit (e.g. last one)
Issue with Tablu-Search Problem
a) Tablu list grows
b) Many runtime parameters
c) Large iterations
d) No global optimum guarantee
e) All correct -> common issues in metaheuristics
Which are nature-inspired?
a) Particle Swarm
b) Evolutionary Programming
c) Genetic Algorithms
d) All
d) All
GA heuristic
a) Stigmergy
b) Cooling rate
c) Hill climbing
d) Crossover
d) Crossover -> combines parent solutions
ILS builds solutions by:
a) Population + selection
b) Simulating insects
c) Forbidding past moves
d) Perturbing local minima
d) Perturbing local minima 0 -> escape local optima
Not a GA parameter?
a) Number of bits
b) Generations
c) Population size
d) Mutation probability
e) All
e) All are parameters