STRUCTURES CERTIFICATION SCRIPT 2026
QUESTIONS WITH SOLUTIONS GRADED A+
◍ 514.
Answer: What is the output of the pseudocode below if the variables
declared in the main program are global?Main Declare X as Integer, Y as
Integer Set X = 1 Set Y = 2 Call Sub(X, Y) Write X Write YEnd
ProgramSubprogram Sub(Integer Num1, Integer Num2 as Reference)
Declare X as Integer Set Num1 = 3 Set Num2 = 4 Set X = 5 Write XEnd
Subprogram
◍ Push(stack, x).
Answer: inserts an item on the top of the stack.
◍ Bianary Search Tree.
Answer: A data structure in which each node stores data and has up to two
children, known as a left child and a right child.
◍ Returns True if any key of the dictionary is true..
Answer: What does the method any(b) return in Python if b is a dictionary?
◍ Quicksort.
Answer: a sorting technique that moves elements around a pivot and
recursively sorts the elements to the left and the right of the pivot
◍ Heap - parent_index.
Answer: parent_index = (node_index - 1) // 2or node_index // 2 - 1
◍ List, Bag.
Answer: ADTs with array, linked list as common underlying DS
◍ What does the method any(b) return in Python if b is a dictionary?.
, Answer: Returns True if any key of the dictionary is true.
◍ Node's ancestors.
Answer: include the node's parent, the parent's parent, etc., up to the tree's
root.
◍ my_list[:].
Answer: Get a copy of the list.
◍ selection sort.
Answer: O(n^2) A sort algorithm that repeatedly searches remaining items
to find the least one and moves it to its final location.
◍ Internal node.
Answer: A node with at least one child.
◍ Initialize the result to an empty list.
Answer: What is the logical first step in an algorithm that extracts all the
positive values from a given list of numbers?
◍ 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
◍ 0, 1, 2, 3, 4, 5.
Answer: What are the official indexes for the list list01 given this
declaration? int[ ] list01 = {0, 2, 4, 6, 8, 10};
◍ Parent.
Answer: A node with a child is said to be that child's parent.
◍ Radix sort.
Answer: 10 buckets
◍ Which command helps to speed up comparisons using dictionary keys
during a dictionary (d) lookup in this pseudocode clip?h = hash(key)for pair
in d: if h == pair[0]: return pair[1].
Answer: hash(object)
,◍ Max-heap remove.
Answer: Always a removal of the root, and is done by replacing the root
with the last level's last node, and swapping that node with its greatest child
until no max-heap property violation occurs.Complexity O(logN)
◍ Fast sorting algorithm.
Answer: A sorting algorithm that has an average runtime complexity of O(N
logN) or better.
◍ 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
◍ It is automatically available for garbage collection..
Answer: What is the effect on the object Computing regarding garbage
collection? Computing obj = new Computing(); obj = null;
◍ A binary tree is perfect if:.
Answer: if all internal nodes have 2 children and all leaf nodes are at the
same level.
◍ Pop(PQueue).
Answer: Returns and removes the item at the front of PQueueExample
starting with priority queue: 42, 61, 98 (front is 42)Pop(PQueue) returns 42.
PQueue: 61, 98
◍ Bag.
Answer: An ADT for storing items in which the order does not matter and
duplicate items are allowed.Underlying data structures: Linked list, Array
◍ Binary search tree (BST).
Answer: An especially useful form of binary tree, which has an ordering
property that any node's left subtree keys ≤ the node's key, and the right
subtree's keys ≥ the node's key. That property enables fast searching for an
item, as will be shown later.*When searching, search always starts at the
root
, ◍ Recursively breaks down a problem into two or more subproblems of the
same or related type.
Answer: What is a characteristic of quick sort?
◍ Chaining.
Answer: handles hash table collisions by using a list for each bucket, where
each list may store multiple items that map to the same bucket.
◍ Dictionary key characteristic.
Answer: They are unique and immutable.
◍ 90 and 99.
Answer: What are the array elements corresponding to the mid-values in the
first and second iterations of a binary search in an array arr = {45, 77, 89,
90, 94, 99, 100} and key = 100?
◍ Common operations for ADT List.
Answer: Append, Prepend, InsertAfter, Print, PrintReverse, Sort, Remove,
Search, IsEmpty, GetLength
◍ string literal..
Answer: Text enclosed in quotes is known as a_________ Text in
______________ may have letters, numbers, spaces, or symbols like "@" or
"#".Strings are immutable. Once created, they can not be changed. To
update a string variable, an entire new string must be assigned to the
variable.In-place modification of string variables is not allowed.
◍ Binary Tree.
Answer: In a list, each node has up to one successor. In a binary tree, each
node has up to two children, known as a left child and a right child. "Binary"
means two, referring to the two children.
◍ constructor.
Answer: The __init__ method, commonly known as a constructor, is
responsible for setting up the initial state of the new instance.
◍ What is the effect on the object Computing regarding garbage collection?