Chapter 14
- What is an algorithm?
A predefined set of computer instructions that complete a specific task.
- How is pseudocode used with algorithms?
Pseudocode is often used to present an algorithm in a language agnostic manner.
- What does O(1) mean?
Constant time complexity.
- What is a more efficient time complexity: O(n*log(n)) or O(n^2)?
O(n*log(n))
- How does merge sort work?
Merge sort uses a divide and conquer methodology.
- Which is more efficient: bubble sort or merge sort?
Merge sort.
- For an array (0..238), how do you retrieve the first element in the array?
Access element 0.
- For an array (1..299), how do you retrieve the last element in the array?
Access element 299.
- How do you calculate the number of elements in an array?
SIZEOF(Array)
/SIZEOF(Array[1])
- Name three sorting algorithms.
- Bubble sort
- Merge sort
- Insertion sort
- Name three areas where an algorithm can be used.
- AI/Machine Learning
- Security
- Sorting
- Encryption/decryption