Unit 6: B2 Programming

Topic 6.4: Algorithms and efficiency Questions

Practice 20 exam-style questions for IB Computer Science Topic 6.4. Review the question stems below, then unlock the full Question Bank to access markschemes, model answers, and AI grading.

1Outline3 marks
2017
A PE teacher's app orders pupils' heights with a selection sort. Outline the main steps involved.
Markscheme and model answer locked
Unlock Question
2Explain2 marks
2015
Ten sensor readings must be put in order. Explain one reason a selection sort could need less work than a bubble sort for this.
Markscheme and model answer locked
Unlock Question
3Choose1 mark
2026
Choose the requirement binary search places on the data.
Markscheme and model answer locked
Unlock Question
4Choose1 mark
2026
Choose the complexity of binary search on a sorted array.
Markscheme and model answer locked
Unlock Question
5Construct5 marks
2023
A list BANNED holds words a chat filter blocks. Construct a Python function is_banned(word) that returns True if word is in BANNED, without using the in operator.
Markscheme and model answer locked
Unlock Question
6Define1 mark
2026
Define what Big O notation describes.
Markscheme and model answer locked
Unlock Question
7Determine2 marks
2026
Determine the Big O complexity of a loop over n elements containing another loop over the same n elements.
Markscheme and model answer locked
Unlock Question
8State2 marks
2026
State the Big O complexity of accessing an array element by index, and of scanning a whole array.
Markscheme and model answer locked
Unlock Question
9Determine2 marks
2026
Determine how the time taken by an O(n squared) algorithm changes when the input triples.
Markscheme and model answer locked
Unlock Question
10State1 mark
2027
A program compares every pupil in a class list of n pupils with every other pupil, using one loop inside another, each running n times. State the time complexity of this algorithm in Big O notation.
Markscheme and model answer locked
Unlock Question
11State1 mark
2020
A linear search looks through an unsorted list of 50 names for a name that is not there. State how many comparisons it makes.
Markscheme and model answer locked
Unlock Question
12State1 mark
2020
State the condition a list must meet before a binary search can be used on it.
Markscheme and model answer locked
Unlock Question
13Outline2 marks
2021
A student says bubble sort and selection sort have nothing in common. Outline one similarity between them.
Markscheme and model answer locked
Unlock Question
14Describe4 marks
2020
A club secretary's program puts members' names into alphabetical order with a bubble sort. Describe the steps involved.
Markscheme and model answer locked
Unlock Question
15Describe4 marks
2020
A quiz app sorts players' scores with a bubble sort. Describe the steps involved.
Markscheme and model answer locked
Unlock Question
16Outline2 marks
2021
A programmer must choose between a bubble sort and a selection sort for data that is often already sorted. Outline one difference that matters here.
Markscheme and model answer locked
Unlock Question
17Identify2 marks
2023
A library catalogue program needs to find books by title. Identify two types of searching algorithm the programmers could use.
Markscheme and model answer locked
Unlock Question
18Construct4 marks
2026
Write a Java method for a linear search that returns the index of a target, or -1 if it is absent.
Markscheme and model answer locked
Unlock Question
19Construct4 marks
2026
Write a Python function for a linear search that returns the index of a target, or -1 if it is absent. Do not use the built-in index() method.
Markscheme and model answer locked
Unlock Question
20State1 mark
2020
A gym stores member IDs in an array in the order members joined. State why a binary search cannot be used on this array.
Markscheme and model answer locked
Unlock Question

Ready to practice Topic 6.4?

Get instant AI feedback on your answers, view detailed markschemes, and track your progress across all IB Computer Science topics.

Start Practising Now