CSC 221 Exam Study Guide (1)
CSC 221 Exam Study Guide (1)
1. APPLICATION OF ARRAYS
Applications include:
Example:
Example: 3 4 + instead of 3 + 4
Example: + 3 4 instead of 3 + 4
Example: 3 + 4
Conversion from Infix to Postfix:
Example: (A + B) * C -> A B + C *
3. EXPRESSIONS
Expressions are combinations of operands (values, variables) and operators (+, -, *, /).
Example:
int x = (a + b) * c;
4. SPARSE ARRAYS
Example:
6. STACK
Operations:
Example in Python:
stack = []
stack.append(10)
stack.append(20)
print(stack.pop()) # Removes 20
7. STACK OPERATIONS
Used in:
- Reversing a string
- Expression evaluation
- Backtracking algorithms
8. CIRCULAR QUEUE
9. SORTING ALGORITHMS
def bubble_sort(arr):
for i in range(len(arr)):
arr = [5, 3, 8, 1]
bubble_sort(arr)
FINAL TIPS