ALGORITHMS OBJECTIVE V1 AND V2
PRACTICE EXAMINATION 2026
QUESTIONS WITH ANSWERS GRADED A+
◍ Parent.
Answer: In a binary tree, a node with a child.Root: The one tree node with
no parent (the "top" node).
◍ How many vertices does this graph have?.
Answer: five
◍ Heap - right_child_index.
Answer: right_child_index = 2 * node_index + 2
◍ Searching in Binary Search Tree.
Answer: O(log n)
◍ How does searching in a Binary Search Tree (BST) start?.
Answer: by visiting the root node.
◍ Shell sort.
Answer: A sorting algorithm that treats the input as a collection of
interleaved lists, and sorts each list individually with a variant of the
insertion sort algorithm. It uses gap values to determine the number of
interleaved lists.
◍ dynamic set.
Answer: a set that can change after being constructed.
◍ [log2N]+1.
Answer: The maximum number of steps required to reduce the search space
, to an empty sublist.
◍ what kind of function would you see with bubble sort?.
Answer: nested loop
◍ The Node Class Has Two Data Members.
Answer: True
◍ What is double hashing in the context of a hash table?.
Answer: An open-addressing collision resolution technique that uses 2
different hash functions to compute bucket indices
◍ For a function to qualify as a hash function it has to have what three
properties.
Answer: StabilityUniformitySecurity
◍ set - union.
Answer: union of sets X and Y, denoted as X Y, is a set that contains
every element from X, every element from Y, and no additional elements
◍ Fast sorting algorithm.
Answer: A sorting algorithm that has an average runtime complexity of O(N
logN) or better.
◍ How does using a dummy node simplify the implementation of linked lists?.
Answer: It removes the need to check for a null head in list operations
◍ binary search.
Answer: efficient sorted list search
◍ Binary search.
Answer: is an algorithm that searches a SORTED LIST for a key by first
comparing the key to the middle element in the list and recursively
searching half of the remaining list so long as the key is not found.
◍ Recursive Algorithm.
Answer: An algorithm that breaks the problem into smaller subproblems and
applies the algorithm itself to solve the smaller subproblems.
, ◍ What does a list ADT commonly hold besides integers.
Answer: strings and objects
◍ Linking together complex nodes into a single structure.
Answer: Linked List
◍ Direct Hash Function.
Answer: Uses the item's key as the bucket index.
◍ dict.keys().
Answer: returns a view object that yields dictionary keys.
◍ 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?
◍ array.
Answer: a data structure that stores an ordered list of items, with each item
is directly accessible by a positional indexhomogeneous data elements
Inserting at the beginning requires making room for the new item. So every
current item must be shifted once.
◍ Linear Search Algorithm.
Answer: Starts from the beginning of a list & checks each element until the
search key is found or the end of the list is reached.Data can be sorted or
unsorted
◍ max-heap.
Answer: a tree that maintains the simple property that a node's key is greater
than or equal to the node's childrens' keys
◍ Which data structure is indexed?.
Answer: Array
◍ set.
Answer: distinct items ADT