C949v4 Study Guide Flashcards
What is the percentage of the assessment that explains algorithms?
29%
What type of search algorithm is linear search?
A basic search algorithm that checks each element sequentially.
What is binary search?
A search algorithm that finds the position of a target value in a sorted array by repeatedly dividing the search interval in half.
Define Big O in the context of time complexity.
A notation used to describe the upper limit of the time complexity of an algorithm.
What is the time complexity of Selection Sort?
O(n^2)
What is the time complexity of Merge Sort?
O(n log n)
What does .pop() do in stacks?
Removes and returns the top element from the stack.
What is a hash table?
A data structure that uses a hash function to map keys to indices of an array for efficient storage and retrieval.
What is the main distinction of a tuple?
Tuples are immutable, meaning their values cannot be changed.
Fill in the blank: A _______ follows the Last-In-First-Out (LIFO) principle.
stack
What is garbage collection?
A process by which a computer’s memory is automatically managed, freeing up memory no longer used.
What are the two possible values of a Boolean data type?
true or false
What is the function of a queue?
A collection of elements that follows the First-In-First-Out (FIFO) principle.
What does a priority queue do?
Dequeues elements based on their priority rather than their insertion order.
What is a binary search tree?
A binary tree where each node has at most two children, with the left child being less than the parent and the right child being greater.
What are the main operations of a deque?
- append()
- appendleft()
- pop()
- popleft()
What is the purpose of the modulo operator in hash tables?
To compute the index for storing the key in the hash table.
What is the average-case time complexity for basic operations in hash tables?
O(1)
What does tree traversal refer to?
The process of visiting each node in a tree in a specific order.
What are the three types of tree traversal?
- Inorder Traversal
- Preorder Traversal
- Postorder Traversal
What is the definition of a set?
An unordered collection of unique elements.
What does the term ‘linked allocation’ refer to?
A memory allocation technique where memory is allocated in linked nodes.
What is the difference between assignment and comparison in programming?
Assignment uses = to assign a value, while comparison uses == to check for equality.
What is the definition of a stack?
A linear data structure that follows the Last In First Out (LIFO) principle.