Data Structures (4.2 - Part 1) Flashcards

1
Q

Arrays

A

Data structures of fixed size that contain data of same type stored in contiguous block of memory

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

How are items in 3d array referred to?

A

First by 2d array no., then by row no. and then by column no.

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

Which 2 data structures can be implemented using linked lists?

A

Stacks and queues

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

What do nodes contain?

A
  • Data item
  • Pointer to next node in sequence
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Null pointer

A

Pointer used to identify last item of data

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

What does use of pointers mean for linked lists?

A

Data doesn’t have to be stored contiguously in memory

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

2 benefits of linked lists

A
  • Size can be dynamically changed easily
  • Easy to use
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Disadvantage of linked lists

A

Slower to access across specific elements than arrays

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

Queue

A

Data structure where items are always added to end and removed from front

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

What type of data structure is queue?

A

FIFO

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

Static queue

A

Queue that is fixed in size

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

Dynamic queue

A

Queue that is able to grow in size when necessary

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

enQueue ()

A

Adds item to rear of queue

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

deQueue ()

A

Removes and displays item at front of queue

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

isEmpty ()

A

Checks to see if queue is empty

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

2 uses of queues

A
  • CPU scheduling
  • Breadth-first traversal of graph
17
Q

Linear queue

A

Type of queue where when item of data is removed from front, all other items move up one place

18
Q

Circular queue

A

Type of queue where when item of data is removed from front, the pointers identifying front and rear of queue are updated

19
Q

Graphs

A

Data structures used to represent data items that have connections between them

20
Q

2 methods of traversing a graph

A
  • Depth first
  • Breadth first
21
Q

Depth-first traversal

A

Involves travelling down one route as far as possible, before reversing and travelling as far down next route as possible

22
Q

Breadth-first traversal

A

Involves visiting all adjoining nodes for each node in turn