Question and Answers
What is a primitive data type? - ANSWER A data type that can only contain one value
What is a composite/compound data type? - ANSWER A data type built by combining
primitive data types, e.g. a class.
What is a data structure? - ANSWER A collection of data that is organized to allow
efficient processing.
What is an abstract data type? - ANSWER A conceptual model that describes how data
is organized and which operations can be carried out on the data, with no information as
to how this is implemented.
What is a static data structure? - ANSWER A data structure that reserves memory for a
set amount of data, e.g. a fixed-size array
What is a dynamic data structure? - ANSWER A memory efficient data structure which
changes in size dynamically.
What are some disadvantages of a dynamic data structure versus a static data
structure? - ANSWER - Accessed by memory location rather than index, which is
sequential, so can take longer to access data.
- Additional memory is needed for pointers.
What is a disadvantage of a static data structure virus a dynamic data structure? -
ANSWER A static data structure can waste memory if it isn't all used, e.g. if an array is
initialized with size 100, but only 10 elements are stored.
What is a queue? - ANSWER A FIFO (first in, first out) abstract data type.
How does a queue work? - ANSWER A pointer to the front of the queue is maintained,
as well as one to the rear.
What is a priority queue? - ANSWER A queue where each element has a priority.
Elements are inserted into the queue depending on their priority relative to the current
elements.
What are the main operations available on a queue? - ANSWER - Enqueue
- Dequeue
- Is Empty
,- Is Full
Time complexity of a linear search - ANSWER O(n)
Prerequisite of a binary search - ANSWER The list must be ordered.
Time complexity of a binary search - ANSWER O(log n)
Binary search method - ANSWER - Choose the middle item in the list
- If the item is the target, the search is complete
- Otherwise, if the target is greater than the middle item, discard the lower half of the list.
Else, discard the higher half.
A binary search tree is an example of which type of tree? - ANSWER Rooted tree
Time complexity of a bubble sort - ANSWER O(n^2)
Time complexity of a merge sort - ANSWER O(n log n)
Steps of a merge sort - ANSWER - Split the list into two lists
- Continue until there are only lists of size 1
- Combine lists in order
How are signed numbers stored using two's complement? - ANSWER The first bit is
negative
Range of binary two's complement numbers with n bits - ANSWER From -(2^(n-1)) to
2^(n-1) - 1
What is an absolute error? - ANSWER The difference between the approximate value of
the binary representation of a number and the original value of the number
How is relative error calculated? - ANSWER Absolute Error / Original Value
What is the purpose of normalising floating point numbers? - ANSWER It provides a
unique representation for a number and allows the maximum possible precision.
How does a normalised positive number always start? - ANSWER 0.1
How does a normalised negative number always start? - ANSWER 1.0
A positive mantissa shifts the binary point in which direction? - ANSWER Right
A negative mantissa shifts the binary point in which direction? - ANSWER Left
What does MIDI stand for? - ANSWER Music Instrument Digital Interface
, What is MIDI? - ANSWER A technical standard that includes hardware specifications
and a protocol for the communication of electronic musical instruments or other devices
What is a MIDI file? - ANSWER A file that contains a list of event messages that explain
what notes must be played and other data about them
Examples of MIDI signals/events - ANSWER - Pitch
- Intensity
- Volume
- Vibrato
- Clock signals to set the tempo
Advantages of MIDI - ANSWER - Uses less storage than a sampled recording
- Performance data easily manipulated
Disadvantage of MIDI - ANSWER - Often doesn't sound realistic
What is an operating system? - ANSWER A collection of programs that control the
operation of computer hardware
What does the operating system do? - ANSWER - Provides a platform for other
software to run on
- Provides a layer of abstraction over the computer hardware
What are utility programs? - ANSWER - Programs that are used to support the efficient
running of a computer system.
- Can be part of the OS or installed separately.
- Not essential.
Examples of utility program tasks - ANSWER - Maintenance
- Analysis
- Configuration
- Optimisation
What are libraries? - ANSWER Collections of prewritten instructions that can be used in
other programs
Why are libraries useful? - ANSWER Common tasks can be written as libraries for
repeated use, which can save time for developers, as it saves them having to rewrite
the instructions
What are translators? - ANSWER Software tools that are used to convert program code
from one format into another