• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 9 páginas
Examen

OCR A Level Computer Science Data Structures Exam Q&A

Document preview thumbnail
Vista previa 2 fuera de 9 páginas

OCR A Level Computer Science Data Structures Exam Q&A

Vista previa del contenido

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)

Información del documento

Subido en
15 de julio de 2025
Número de páginas
9
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$18.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
lectknancy
3.8
(84)
Vendido
348
Seguidores
28
Artículos
26343
Última venta
1 semana hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes