Data types Flashcards

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

Define tuple

A

ordered sequence of elements that is immutable

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

Define immutable

A

values within cannot be modified whilst the program is running

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

Define List

A

abstract data type that describes a linear collection of data items in some order, occupying a specific position in the list

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

Define static list

A

when it is full, you cannot add any more items to the list.

when it is empty, or partially full, you can be wasting memory space

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

Define Linked List

A

Elements are called nodes which stores:

  • data relating to the element.
  • pointer to next node.
  • head of the list for start node (null value when empty)
  • tail pointer for end of the list if queue
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Define Doubly Linked List

A

has two pointer, to the next and previous node.

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

Define Stack

A
  • abstract data type that holds an ordered linear sequence of items
  • pointer at the top of the stack
  • LIFO
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Applications of stacks

A
  • converting postfix to infix notation
  • undo and redo operations
  • call stack
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Operations of stacks

A
  • push()
  • pop()
  • peek()
  • is_empty()
  • is_full()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly