ALGORITHMS OBJECTIVE V1 AND V2
CERTIFICATION SCRIPT 2026 QUESTIONS
WITH SOLUTIONS GRADED A+
◍ Are Big-O cases used in the best or worst situations?.
Answer: Worst
◍ log_2(key).
Answer: BinarySearch number of times to find num
◍ In soc[5].
Answer: An array soc of size 1009 is used where the index is an integer in
[0,1008] and the hash-function key%1009. Where will the data associated
with the key given by the last 4 social security digits ‘2023’ be stored?
◍ dict.values().
Answer: returns a view object that yields dictionary values.
◍ Linear Search.
Answer: A search algorithm that starts from the beginning of a list and
checks each element until the search key is found or the end of the list is
reached.
◍ Dictionary (map).
Answer: ADT that associates (or maps) keys with valuescommon underlying
DS: has table, binary search tree
◍ hash table searching.
Answer: Hash tables support fast search, insert, and remove.Requires on
average O(1)Linear search requires O(N)
,◍ Which value would be returned from executing the dequeue operation on the
queue 7,9,8 (with 7 as the front)?.
Answer: 7
◍ Insertion Sort.
Answer: A sorting algorithm that treats the input as two parts, sorted and
unsorted, and repeatedly inserts the next value from the unsorted part into
the correct location in the sorted part. Has a complexity of O(N^2). For
sorted or nearly sorted inputs, it's runtime is O(N).
◍ Which command will return true if x is in a list, otherwise return false?.
Answer: Contains(Object x)
◍ O(N^2).
Answer: Quadratic runtime complexity.
◍ stack.
Answer: LIFO ADT
◍ binary tree.
Answer: each node has 0 to 2 children
◍ immutable.
Answer: (adj.) not subject to change, constant
◍ in-place modification.
Answer: The capability of a list to grow and shrink without the program
having to replace the entire list with an updated copy.
◍ Time complexity for merge sort.
Answer: O(n log n)
◍ Underlying data structures: Heap.
Answer: Priority queue
◍ What would be the best data structure for a hash table with simple
chaining?.
Answer: doubly linked list
, ◍ my_list[start:end].
Answer: Get a list from start to end (minus 1).Code:my_list = [5, 10,
20]print(my_list[0:2])Output: [5, 10]
◍ A data structure where nodes have parent-child (1:N) relationship.
Answer: Tree
◍ reclaims memory from data structures implemented using linked
allocations..
Answer: What is true about garbage collection?
◍ Bucket sort.
Answer: A numerical sorting algorithm that distributes numbers into
buckets, sorts each bucket with an additional sorting algorithm, and then
concatenates buckets together to build the sorted result.
◍ Which method removes all keys from a dictionary?.
Answer: keys();
◍ Effectiveness.
Answer: Indicates that an algorithm avoids excessive execution times.
◍ Graph.
Answer: A data structure for representing connections among items, and
consists of vertices connected by edges. A vertex represents an item, and an
edge represents a connection between the vertices.
◍ min-heap.
Answer: tree w node key <= child keys
◍ List.
Answer: ADT that has elements of the same type so that the elements can be
retrieved based on index or position
◍ How many nodes can be affected by the 'insert_after' method for a
doubly-linked list?.
Answer: 3
◍ What is the runtime complexity of the prepend() operation for an