2.1.4 - Thinking Logically Flashcards
Component 2
What are the examples of branching?
IF Statement
Case/Switch Statement
BRP / BRA / BRZ
What decisions are made in the enqueue and dequeue algorithms?
Format to use: What is the decision?| Action if true | Action if false:
Enqueue – Is the queue already full? | Return error | enqueue item to queue and adjust pointer
Dequeue – Is the queue empty? | Return error | dequeue item and adjust pointer
What decisions are made in the pop and push algorithms?
Format to use: What is the decision?| Action if true | Action if false:
Push – Is the stack already full? | Return error | push item and adjust pointer
Pop – Is the stack empty? | Return error | pop item and adjust pointer