Data Types Flashcards

(15 cards)

0
Q

What are queues

A

Queues are first in first out data structure.

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

What are linked list?

A

Linked list are lost where each item contains the address of the next time in the list

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

What’s an example of a queue

A

A video buffer is an example of a use for a queue.

Printing job, simulation

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

What operation can be carried out on a queue

A
  • add a new item to the rear of the queue
  • remove an item from the front of the queue
  • check whether queue is empty
  • return value of the first element and remove it
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the 3 different types of queues

A

Circular queues, linear queues and priority queues

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

What are circular queues

A

A circular queue is a queue which has a fixed amount of space and where both end are treated as being connected together.

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

What are the two variable that a circular queue require

A

A circular queue requires one variable which points to the head and the other the tail of the queue

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

What are linear queues

A

Linear queues are queues where elements are always added at one end of a list and removed at the other end.

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

What are priority queues

A

Priority queues are queues where items are removed in order of their priority, regardless of the order In which the items are added

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

How can you check if a circular queue is empty without using a special empty variable?

A

Head==Tail

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

How can you check if a circular queue is full without using a special full variable

A

Head == tail + 1

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

What are stacks?

A

Stacks are last in first out data structure. Used when data added last is required first.

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

What’s the most common use for stacks?

A

Calling procedures during a program.

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

What are the operations that can be carried out by stacks

A
  • Check whether the stack is empty
  • check whether the stack is full or not
  • Look at the top value and remove it (pop)
  • put a new value on top of the existing stacks (push)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How to determine whether the stack is empty

A

Empty stack has topofstack value of zero.

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