ALGORITHMS CERTIFICATION SCRIPT 2026
QUESTIONS WITH SOLUTIONS GRADED A+
◍ A stack s, a queue q, and a max value priority queue p each have a single 3
in them. Next s.push(4), q.push(4), and p.push(4) are executed. What is the
triple (s.pop(), q.pop(), p.pop())?.
Answer: (4,3,4)
◍ Polynomial time algorithm.
Answer: An algorithm whose execution time grows as a polynomial of input
size. An efficient algorithm is one whose runtime increases no more than
polynomially with respect to the input size.
◍ Radix sort.
Answer: 10 buckets
◍ bucket.
Answer: each array element in a hash tableie A 100 elements hash table has
100 buckets
◍ BST node's predecessor.
Answer: the node that comes before in the BST ordering.
◍ How many leaf nodes does this tree have?.
Answer: Two
◍ A data structure that stores subitems, with a name associated with each
subitem..
Answer: record
◍ Bucket.
Answer: A large set of floating-point numbers that are in range from 0.0 to
, 1.0 and are uniformly distributed across the range need to be sorted. Which
sort of procedure is useful when the input is uniformly distributed over the
range?
◍ Binary search is much more efficient than linear search but requires the
array or list to be sorted..
Answer: It works by repeatedly dividing the search interval in half. If the
target value is less than the middle element, the search continues in the left
half, otherwise in the right half.
◍ Remove(list, x).
Answer: Removes xRemove(list, 77), list: 99
◍ Head.
Answer: A singly-linked list's first node.
◍ What is an Algorithm?.
Answer: a finite set of instructions carried out in a specific order to perform
a particular task.
◍ "bird".
Answer: Items were added sequentially in this stack starting with "dog":
"bird""rabbit""cat""dog" What is the return value of the pop operation?
◍ Sequence Data Type.
Answer: Data types which are collections of objects ordered by position.
◍ Simplify: log2N.
Answer: O(logN)
◍ Dictionary (Map).
Answer: An ADT that associates keys with values.
◍ stack.
Answer: ADT which items are only inserted on or removed from the top of a
stackLIFO
◍ cycle.
Answer: a path that starts and ends at the same vertex.
, ◍ Backtracking Algorithm.
Answer: A trial-and-error technique used to explore potential solutions by
undoing choices when they lead to an incorrect outcome, commonly
employed in puzzles and optimization problems.
◍ Heap - left_child_index.
Answer: left_child_index = 2 * node_index + 1
◍ Space Complexity.
Answer: A function, S(N), that represents the number of fixed-size memory
units used by the algorithm for the input of size N.
◍ Types of Algorithms.
Answer: Brute Force AlgorithmRecursive AlgorithmEncryption
AlgorithmBacktracking AlgorithmSearching AlgorithmSorting
AlgorithmHashing AlgorithmDivide and Conquer AlgorithmGreedy
AlgorithmDynamic Programming Algorithm Randomized Algorithm
◍ 90 and 99.
Answer: What are the mid-values in the first and second levels of recursion
in this binary search?int arr = {46, 76, 89, 90, 94, 99, 100} and key = 99
◍ list traversal.
Answer: An algorithm that visits all nodes in the list once and performs an
operation on each node.
◍ Equation for finding the middle value of an array.
Answer: (high + low)/2 (DO NOT ROUND UP)
◍ (4,4,3).
Answer: A stack s, a queue q, and a max value priority queue p each have a
single 3 in them. Next s.push(4), q.push(4), and p.push(4) are executed.
What is the triple (s.pop(), q.pop(), p.pop())?
◍ dynamic programming.
Answer: uses computer memory to avoid recomputing previously computed
results