Data Structures Flashcards

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

What is an ADT?

A

An ADT is a data type that has its own unique operations which define how data should interact with a
variable of that data type.

It is a type or class for objects whose behaviour is defined by a set of values and a set of operations.

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

What is a Stack?

A
  • A set of objects on top of one another.
  • A stack is a last in first in (LIFO) ADT which can be created using an array and a variable called top.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Stack Operations

A
  • Push( ) - add values to a stack
  • Pop ( ) - removes a value fro the stacks, from the top.
  • isFull ( ) - returns true if the ADT is full (no data can be added to it)
  • isEmpty ( ) - returns true if the ADT is empty (no data can be removed from it)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a Queue?

A
  • A set of objects forming a line where the first one who is in the line is the first one addressed.
  • New objects are formed to the end of the line.
  • Objects removed from the front are added to the end (FIFO).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Queue Operations

A
  • Enqueue ( ) - adds a value to the end of the queue.
  • Dequeue ( ) - deletes a value from the front of the queue.
  • isFull ( ) - returns true if the ADT is full (no data can be added to it)
  • isEmpty ( ) - returns true if the ADT is empty (no data can be removed from it)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a Linked List?

A
  • A Linked List is a linear data structure.
  • The elements are linked using pointers.
  • They include a series of connected nodes and each node stores the data and the address of the next node.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly