1.4.2 Data Structures Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

what is the difference between static and dynamic structures

A

static structures have a fixed length while dynamic structures have a changeable length

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is the difference between an array and a tuple(1)

A

Tuples are immutable (data cannot be changed), arrays can be modified(1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is a 2d array

A

a 2d array is an array that contains other arrays

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is a queue

A

a static first in first out structure for ordering data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is an abstract data structure

A

a data structure made by the programmer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is a list

A

an abstract data structure which stores a number of items

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what is a linked list

A

an abstract dynamic data structure to ordered data from different locations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what is a stack

A

a last in first out data structure used to store instructions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what does the purpose of the call stack

A

to hold the active suboutines and their data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is the difference between a list and a stack

A

a list is first in first out a stack is last in first out

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what is the difference between a weighted and unweighted graph

A

with a weighted graph each edge has a value with an unweighted graph edges have no value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what is the difference between a directed and undirected graph

A

with a directed graph edges can only be traversed in one direction with an undirected graph they can be traversed in any direction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what is an adjacency matrix

A

a table to show the relationships in a graph

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what is a tree

A

an abstract data structure used to represent structures making data easier to search

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what is a Root Parent and Child

A

root: node with no incoming edges parent: a node with an outgoing edge child: a node with an incoming edge

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what is the difference between depth and breadth first traversal

A

depth: explore the entirety of a route before continuing to the next breadth: checking all available roots from a node before progressing

17
Q

what is a binary search tree

A

a rooted tree each node has a maximum of 2 children

18
Q

Describe the difference between an array and a linked list.(2)

A

A linked list is a dynamic data structure (1) whereas an array is static (1).

19
Q

Define the term ‘array’. (2)

A

A data structure (1) Has a single identifier (1).

20
Q

Describe what is meant by the term ‘linked list’ (3)

A

A data structure (1) Each node consists of data and pointer. (1) Pointer gives location of next node (1)

21
Q

State which of a stack or queue would be considered as a ‘First In First Out’ data structure.(1)

A

A queue (1)

22
Q

What is meant by a ‘tuple’? (3)

A

A tuple is an ordered sequence of elements that is immutable (1) which means that the values within the tuple cannot be modified when the program is running (1) . The elements of a tuple can be of different data types (1)

23
Q

What is meant by a ‘list’? (3)

A

A list is an abstract data type (1) that describes a linear collection of data items in some order (1) in that each element occupies a specific position in the list.(1)

24
Q

What is meant by a ‘record’

A

A record is a data structure (1) that consists of a fixed number of variables called fields (1) . Each field in a record can have a different data type (1)

25
Q

State the meaning of the term static.(1)

A

Size is fixed when structure created cannot change during processing (1)

26
Q

State one type of data structure that is always considered to be static.
(1)

A

Array (1)

27
Q

State the meaning of the term dynamic.(1)

A

Size can change during processing (1)

28
Q

Give one disadvantage of using a dynamic data structure.(1)

A

Storage required is unknown initially (1) OR more difficult to program (1)

29
Q

How would you add a new value to an unordered linked list? (3)

A

Create a node with the value (1) and set the next pointer to the value of the head pointer (of the linked list) (1) and set the head pointer (of the linked list) to point to the new node (1)

30
Q

What is meant by a graph having a loop? (1)

A

It has an edge that connects a node to itself (1)

31
Q

What is meant by the path of a graph? (1)

A

It is the sequence of nodes that are connected by edges (1)

32
Q

What is meant by the degree of a node? (1)

A

The number of other nodes that it is connected to (i.e. the number of neighbours it has) (1)

33
Q

Define the term ‘stack’. (4)

A

It is an abstract data type (1) that holds an ordered (1) linear sequence of items (1). It is a last in first out structure (1)

34
Q

Define the term ‘queue’. (4)

A

It is an abstract data type (1) that holds an ordered (1) linear sequence of items (1). It is a first in first out structure (1)

35
Q

Define a ‘binary tree’. (2)

A

It is a rooted (1) tree where every node has at most two children (1)