• Verkeerd document? Gratis ruilen
  • Geschreven door studenten die geslaagd zijn
  • Direct beschikbaar na je betaling
  • Online lezen of als PDF
Verkopen
Kies je studieland
Kies je taal
Document preview thumbnail
Voorbeeld 2 van de 9 pagina's
Tentamen (uitwerkingen)

OCR A Level Computer Science Data Structures Exam Q&A

Document preview thumbnail
Voorbeeld 2 van de 9 pagina's

OCR A Level Computer Science Data Structures Exam Q&A

Voorbeeld van de inhoud

OCR A Level Computer Science Data
Structures Exam Q&A

What is a record data structure? - ANSWER-A collection of related fields (variables)
linked to a single entity
- each field in record can be a different data type (i.e. records can have
heterogenous data types)

How do you construct a record data structure? - ANSWER-1) Define record structure
- what fields will be in record?
2) Declare a variable/array to be used with record structure (e.g. Car1 = (record
structure) TCar)
3) Assign and retrieve data from the variable inside record structure

What is a tuple and its features? - ANSWER-Similar to an array - variable that can
contain more than 1 data item and referenced by an index (so ordered collection),
but immutable + can store heterogenous data types

Features:
- Static - size/length of structure cannot change at run-time
- Immutable - structure/data it contains cannot be changed at run-time

What are the key features of a stack data structure? - ANSWER-- Linear data
structure - all data stored in order added
- Last In First Out (LIFO) data structure - last item to be added to stack at the top of
it, and are first ones to be removed from it
- has a stack pointer that indicates the node/item at the top of it
- "push" = adding to stack, "pop" = removing from stack
- "peeking" = viewing the item at the top of the stack without removing it from the
stack

What is stack overflow/underflow? - ANSWER-Stack overflow - attempting to push
an item onto a full stack
Stack underflow - attempting to pop an item off of an empty stack

How are stacks implemented? - ANSWER-Using a linked lists/array, but can use
OOP

What are some examples of the uses of stacks? - ANSWER-Used by processors to
track the flow of programs
- when subroutine called, PC stores instruction it has to return to once subroutine
completed onto stack
Performing depth-first searches on graph data structures
Keeping track of user inputs for undo operations
Backtracking algorithms
Evaluating mathematical expressions without brackets

, What are the key features of a queue data structure? - ANSWER-- Linear data
structure - all data stored in order added
- FIFO data structure - first item added to queue first one to be removed
- "enqueued" = adding to queue, "dequeue" = removing from queue
- can peek at front of queue like stacks can
- Has both a back/tail pointer (always points to last item in queue) and a front/head
pointer (always points to first item in queue)
- Can have priority queue where important items jump to front spaces in queue

What is queue overflow/underflow? - ANSWER-Queue overflow - attempting to
enqueue an item onto a full stack
Queue underflow - attempting to dequeue an item off of an empty stack

How can queues be implemented? - ANSWER-Using an array or OOP
- implementing with array can cause problems - front + back pointers move in same
direction as are added/removed and gradually move away from front of array, so it
runs out of space

What are circular queues and how can they be useful? - ANSWER-A type of queue
where the back pointer cycles back to the front of an array when it reaches the end
of it
Solves the issues of implementing a queue in a normal linear array and useful if you
want to restrict the number of items in an array + have a known memory footprint
(e.g. sprites in game design)

What are the uses of queues? - ANSWER-Processor scheduling
Transferring data between processors and printers
Performing breadth-first searches on graph data structures

What is a linked list? - ANSWER-A type of list where the order of items/nodes is
determined by a series of pointers linking them together (not by their physical order
in memory)
- start pointer identifies first node in list
- has the same features as a normal list - dynamic + mutable

What is a doubly/circular linked list? - ANSWER-Doubly linked list - linked list where
nodes have extra pointer to point back to previous item
Circular linked list - linked list where the last node points back to the first node

How do you implement linked lists and the what are the benefits of each
implementation? - ANSWER-Can implement with a static array:
- in static arrays data stored contiguously in relation to base address, so linked lists
can change the logical order of this data in the array while its still stored contiguously
physically
Can also implement with OOP (much more beneficial):
- linked lists that use object can use any available memory address to store data
(doesn't need to be contiguous in any way)
- can change data dynamically through this (unlike static array)

Documentinformatie

Geüpload op
15 juli 2025
Aantal pagina's
9
Geschreven in
2024/2025
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden
$18.99

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
lectknancy
3.8
(84)
Verkocht
348
Volgers
28
Items
26343
Laatst verkocht
1 week geleden



Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen