Data Structures Flashcards

Programming (21 cards)

1
Q

How many pointers do linear queues have?

A

Two: front and rear

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

What would this linear queue look like after the operation queue.dequeue()? (Front: Jack, Rear: Emily)

A

Front Rear – Emily

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

For what do the letters FIFO stand?

A

First in, first out

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

What data structure are queues based on?

A

Arrays

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

Which abstract data structure operates on a FILO basis?

A

Stacks

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

Define “Abstract data structure”

A

Data structures that don’t exist as data structures in their own right but make use of other data structures to form a new way of storing data

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

Define “array”

A

A finite, indexed set of related elements which have the same data type

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

What would this circular queue look like after the operation queue.enqueue(“Minta”)? (Front: Sarah, Rear: Angus)

A

Rear Front – Sarah Angus Minta

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

If two items in a priority queue have the same priority, what order are they removed in?

A

First in, first out

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

a = [4, 5], b = [5, 3]. What is a * b?

A

35 ((4×5) + (5×3))

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

What is the name of the procedure that adds an item to a stack?

A

Push

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

What is the name of the procedure that removes an item from a stack?

A

Pop

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

How many pointers do stacks have?

A

One: top

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

Which are best suited to dense graphs: adjacency matrices or adjacency lists?

A

Adjacency matrices

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

What is meant by a tree?

A

A connected, undirected graph with no cycles

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

If viewed as a list of numbers, which data structure can represent a vector?

A

A one-dimensional array

17
Q

What is said to occur when two values produce the same hash?

18
Q

What is a dictionary?

A

A collection of key-value pairs

19
Q

Which type of data structures are fixed in size?

A

Static data structures

20
Q

How is translation of vectors achieved?

A

Vector addition

21
Q

Define a Tuple

A

An ordered, immutable sequence of elements used to store related data.

Cannot be changed after creation, can hold different data types