Time allowed: 2 hours 30 minutes
Materials
For this paper you must have:
• a computer
• a printer
• appropriate software
• the Electronic Answer Document
• an electronic version and a hard copy of the Skeleton Program
• an electronic version and a hard copy of the Preliminary Material
• an electronic version of the Data Files game1.txt and locks.txt
You must not use a calculator.
Instructions
• Type the information required on the front of your Electronic Answer Document.
• Before the start of the examination make sure your Centre Number, Candidate Name and
Candidate Number are shown clearly in the footer of every page (also at the top of the front
cover) of your Electronic Answer Document.
• Enter your answers into the Electronic Answer Document.
• Answer all questions.
• Save your work at regular intervals.
Information
• The marks for questions are shown in brackets.
• The maximum mark for this paper is 100.
• No extra time is allowed for printing and collating.
• The question paper is divided into four sections.
Advice
You are advised to allocate time to each section as follows:
Section A – 40 minutes; Section B – 20 minutes; Section C – 20 minutes; Section D – 70 minutes.
At the end of the examination
Tie together all your printed Electronic Answer Document pages and hand them to the Invigilator.
Warning
It may not be possible to issue a result for this paper if your details are not on every page of your
Electronic Answer Document.
IB/G/Jun22/E12 7517/1
, 2
Section A
You are advised to spend no longer than 40 minutes on this section.
Type your answers to Section A in your Electronic Answer Document.
You must save this document at regular intervals.
0 1 Big-O notation is used to express the time complexity of an algorithm. Table 1
contains a list of algorithms.
State the Big-O time complexity of each of these algorithms. The first row has been
completed for you.
Table 1
Algorithm Time complexity
Binary tree search O(log n)
Bubble sort
Linear search
Merge sort
Copy the contents of the unshaded cells in Table 1 into the table in your Electronic
Answer Document.
[3 marks]
IB/G/Jun22/7517/1
, 3
0 2 A queue data structure can be implemented as a static data structure using an array.
0 2 . 1 Describe the method that would need to be followed to attempt to remove an item
from a circular queue implemented as a static data structure using an array.
Your method should deal appropriately with any issues which could arise.
[4 marks]
0 2 . 2 Describe three differences between dynamic and static data structures.
[3 marks]
Figure 1 shows data that has been stored in a stack implemented using an array S.
Figure 1
[7]
[6]
[5]
[4]
[3]
[2] Jib Top = 2
[1] Skye
[0] Harry
0 2 . 3 What value will be returned by applying the peek operation to S?
[1 mark]
0 2 . 4 What value will be returned by applying the pop operation to S?
[1 mark]
0 2 . 5 Explain how a single stack can be used to reverse the order of the items in a queue.
[2 marks]
Turn over for the next question
Turn over ►
IB/G/Jun22/7517/1
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller ubuntu. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for £6.49. You're not tied to anything after your purchase.