Data Structures Flashcards

1
Q

What is a Primitive Data Type

A

One in which the set of values of the type are scalar meaning single values.

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

What is a Composite Data Type

A

Any data type which can be constructed using the programming languages primitive data types and other composite types.

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

What is Abstraction

A

A representation where all unnecessary details are removed.

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

What is a List

A

An ordered collection of data items.

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

What is a Dynamic Data structure

A

Can change size at run time.

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

Advantages of Static Data Structures

A

Access times are constant.

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

Disadvantages of Static Data Structures

A

Unutilised spaces are a waste in memory.

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

Advantages of Dynamic Data Structure

A

Avoid wasting memory space.

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

Disadvantages of Dynamic Data

A
  • Resize operation takes time.
  • In dynamic non-linear structures the access time depends on the position of the element in the structure.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a Stack

A

A Last In First Out data structure where data can only be accessed at the top end.

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

What is the function of the Push() Operation in a stack

A

An item is added to the top of the stack

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

What is the function of the Pop() Operation in a stack

A

The top item is removed from the stack.

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

What is the function of the Peek() / Top() Operation in a stack

A

Returns the value of the top element of the stack, without removing it.

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

What is Reverse Polish Notation

A

The operator comes after the value it is operated on.

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

What are the Advantages of Reverse Polish Notation

A
  • No need for Brackets.
  • No need to define operator precedence (BIDMAS)
  • Expression can be evaluated serially - no need to bracktrack.
  • Faster for computers to evaluate.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a Queue?

A

A First In First Out data structure

17
Q

What is the function of the Enqueue() Operation in Queues

A

An item is added in the location of the rear pointer of the queue.

18
Q

What is the function of the Dequeue() Operation in Queues

A

AN item is removed in the location of the front pointer of the queue.

19
Q

What is a Linear Queue

A

Elements join the queue at one end and leave at the other end.

20
Q

What is a Shuffle Queue

A

The front of the queue is fixed as the first data slot. Each time an element is removed, other elements move one position forward to fill the vacated slot.

21
Q

What is a Circular Queue

A

When the array element with the largest possible index has been used, the next element to join the queue reuses the vacated position at the beginning of the array.

22
Q

What is a Priority Queue

A

Each element of priority queue has an associated priority.

23
Q

What is Recursion

A

Recursion happens when a function calls itself and has a terminating condition.