Sequences + Recursion | Stacks and Queues Flashcards
1
Q
What are sequences
A
2
Q
What is the recursive definition of sequences?
A
3
Q
What is the non-recursive definition of sequences?
A
4
Q
What is proof by induction?
A
5
Q
What are the 3 rules of recursive functions?
A
- Must have base case
- Must call itself recursively
- Must change its state and move towards the base case
6
Q
What are data structures?
A
- Data elements are arranged sequentially OR linearly
- Elements are attaches to its previous and next adjacent
- Single run = traverse all elements
- Easy to implement → computer memory is in a linear arrangment
7
Q
What are stacks
A
8
Q
What are the uses of stacks?
A
- LIFO
- Expression evaluation
- String reversal
- Calculating REVERSE POLISH NOTATIONS
- Compilers - syntax evaluation
- Recursion
- Redo/Undo features
9
Q
What are queues?
A
10
Q
What are the uses of queues?
A
- FIFO
- Printer queues
- Email/Message Queues