ALGORITHMS OBJECTIVE V1 AND V2
COMPREHENSIVE STUDY GUIDE 2026 FULL
QUESTIONS AND SOLUTIONS GRADED A+
◍ Min Heap.
Answer: a tree that maintains the simple property that a node's key is less
than or equal to the node's childrens' keys
◍ Types of Algorithms.
Answer: -Brute-force algorithm-Searching algorithm-Sorting
algorithm-Recursive algorithm-Backtracking algorithm-Divide & conquer
algorithm-Greedy algorithm-Dynamic programming algorithm-Randomized
algorithm
◍ Which attribute of a recursive function makes it unique?.
Answer: Calls itself
◍ What is a class in OOP?.
Answer: A blueprint for creating objects(instances)
◍ Which factor helps measure the reusability of an algorithm?.
Answer: Extensibility
◍ Expression.
Answer: A combination of items such as variables, literals, and operators
that evaluates to a value. Can be just a literal, just a variable, or some
combination of variables, literals, and operators.
◍ When the program uses key-value pairs as its data.
Answer: When should a dictionary be used instead of a list?
,◍ mutable.
Answer: open to or capable of change, fickle
◍ Heapsort.
Answer: A sorting algorithm that takes advantage of a max-heap's properties
by repeatedly removing the max and building a sorted array in reverse order.
◍ Push().
Answer: Stack: numStack 7, 5push() adds a node to the top of the stack's list
by calling LinkedList's prepend() method. *New elements are place on the
top of the stack, not at the bottom of the stack. push(numStack, 8) = 8, 7,
5Queue: queue: 43, 12, 77push() adds a node to the end of the queue's list
by calling LinkedList's append() method. *New elements are added to the
end of a queue.Push(queue, 56). Queue: 43, 12, 77, 56Priority Queue:The
priority queue push operation inserts an item such that the item is closer to
the front than all items of lower priority, and closer to the end than all items
of equal or higher priority.
◍ What is a characteristic of quick sort?.
Answer: Recursively breaks down a problem into two or more subproblems
of the same or related type
◍ Height.
Answer: The largest depth of any node. A tree with one node is 0.
◍ Remove(list, x).
Answer: Removes x Remove(list, 77), list: 99
◍ A node with one key is called.
Answer: 2-node
◍ Dictionary keys must be _____ and ______.
Answer: uniqueimmutable
◍ stack.
Answer: ADT which items are only inserted on or removed from the top of a
stackLIFO
, ◍ Open Addressing.
Answer: A collision resolution technique where collisions are resolved by
looking for an empty bucket somewhere in the table.
◍ Byte.
Answer: Data type is an 8-bit signed two's complement integer. The byte
data type is useful for saving memory in large arrays.
◍ class.
Answer: The ________ keyword can be used to create a user-defined type of
object containing groups of related variables and functions.initial
capitalization for class names. Thus, appropriate names might include
LunchMenu, CoinAmounts, or PDFFileContents.
◍ Hash table.
Answer: A data structure that stores unordered items by mapping (or
hashing) each item to a location in an array.
◍ Queue.
Answer: ADT in which items are inserted at the end of the queue and
removed from the front of the queueFIFO
◍ what is the order in a b-tree?.
Answer: the max number of children a node can have
◍ pivot.
Answer: Any value within the array being sorted, commonly the value of the
middle array element. Ex: For the list (4, 34, 10, 25, 1), the middle element
is located at index 2 (the middle of indices [0, 4]) and has a value of 10.
◍ rich comparison methods.
Answer: Methods like __lt__ that can be altered using operator overloading
◍ What does a trie search operation return?.
Answer: The terminal node corresponding to the string, or null if the string
is not in the trie.
◍ What is the best case time complexity?.