- IB
- 4. Computational thinking, problem-solving and programming
Practice 4. Computational thinking, problem-solving and programming with authentic IB Computer Science (CS) exam questions for both SL and HL students. This question bank mirrors Paper 1, 2, 3 structure, covering key topics like programming concepts, algorithms, and data structures. Get instant solutions, detailed explanations, and build exam confidence with questions in the style of IB examiners.
For an identified application, explain why a binary search would be preferred to a linear search.
Identify two characteristics of a genetic algorithm.
Outline what is meant by the term "elitism".
Describe the steps involved in using the bubble sort algorithm to sort an array.
The case study states: "Successful implementations of genetic algorithms strike a natural balance between exploration and exploitation, and techniques such as simulated annealing can fine-tune that balance as the algorithm progresses towards convergence" (page 7, Discussion). Discuss the role of convergence in genetic algorithms and how exploration and exploitation can affect its success.
Outline the need for a translation process from high level language to machine code.
Identify one fundamental operation of a computer.
Distinguish between fundamental and compound operations of a computer.
Two selection methods that could be applied to the travelling salesman problem are roulette wheel selection and tournament selection.
Evaluate these two selection methods.
Two fundamental operations of a computer are add and retrieve. State another two fundamental operations.
Outline the need for higher level languages.
Explain two benefits of using sub-procedures within a computer program.
Identify three characteristics of a collection.
Collection NUMBERSalready exists and stores real numbers.
Construct in pseudocode an algorithm, using the access methods of a collection, which will iterate through the collection NUMBERSand count how many elements stored in the collection are in the interval .
The final answer should be output.
List the output from the given algorithm for the following input.
2, 6, 8, 9, 12, 15, 18, 20
loop for Count from 0 to 7
input NUMBER
if NUMBER div 2 = NUMBER / 2 then
if NUMBER div 3 = NUMBER / 3 then
output NUMBER
end if
end if
end loop