Data types Flashcards
1
Q
Define tuple
A
ordered sequence of elements that is immutable
2
Q
Define immutable
A
values within cannot be modified whilst the program is running
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
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
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
6
Q
Define Doubly Linked List
A
has two pointer, to the next and previous node.
7
Q
Define Stack
A
- abstract data type that holds an ordered linear sequence of items
- pointer at the top of the stack
- LIFO
8
Q
Applications of stacks
A
- converting postfix to infix notation
- undo and redo operations
- call stack
9
Q
Operations of stacks
A
- push()
- pop()
- peek()
- is_empty()
- is_full()