Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.
Question 1 of 60 · Definition of linked list · Easy
What is a linked list?
Not quite. Try another option.
Answer: A collection of nodes connected by links
A linked list consists of nodes, with each node connected to another using a link or pointer.
Question 2 of 60 · Implementation of singly linked list · Easy
What does a node in a singly linked list usually contain?
Not quite. Try another option.
Answer: Data and a link to the next node
Each node in a singly linked list stores data and a link to the next node.
Question 3 of 60 · Implementation of singly linked list · Easy
What does the head of a singly linked list refer to?
Not quite. Try another option.
Answer: The first node in the list
The head stores a reference to the first node of the linked list.
Question 4 of 60 · Singly linked list traversal · Easy
Where does traversal of a singly linked list normally begin?
Not quite. Try another option.
Answer: At the head node
Traversal starts at the head and follows each next link until the end.
Question 5 of 60 · Singly linked list traversal · Easy
Which value usually marks the end of a singly linked list?
Not quite. Try another option.
Answer: A link equal to null
The next link of the final node is null, indicating that no node follows it.
Question 6 of 60 · Singly linked list insertion · Easy
When inserting a new node at the beginning of a singly linked list, what should the head reference afterward?
Not quite. Try another option.
Answer: The newly inserted node
After insertion at the beginning, the new node becomes the first node and is referenced by the head.
Question 7 of 60 · Singly linked list insertion · Easy
To insert a node after a given node, which link must be updated?
Not quite. Try another option.
Answer: The given node's next link
The links are adjusted so that the given node points to the new node.
Question 8 of 60 · Singly linked list deletion · Easy
What happens to the head when the first node of a singly linked list is deleted?
Not quite. Try another option.
Answer: It points to the second node
The second node becomes the first node, so the head is updated to reference it.
Question 9 of 60 · Linked list underflow and overflow conditions · Easy
When does linked list underflow occur?
Not quite. Try another option.
Answer: When deleting from an empty list
Underflow occurs when a deletion is attempted but the linked list contains no nodes.
Question 10 of 60 · Linked list underflow and overflow conditions · Easy
When can linked list overflow occur?
Not quite. Try another option.
Answer: When no memory is available for a new node
Linked list overflow occurs when the system cannot allocate memory for another node.
Question 11 of 60 · Introduction to trees · Easy
Which description best matches a tree data structure?
Not quite. Try another option.
Answer: A structure organized as a hierarchy
A tree organizes nodes hierarchically using parent-child relationships.
Question 12 of 60 · Tree terminology: root, edge, parent, child, siblings, leaf, degree, level, height, depth, path and subtree · Easy
What is the topmost node of a tree called?
Not quite. Try another option.
Answer: Root
The root is the topmost node from which the rest of the tree begins.
Question 13 of 60 · Tree terminology: root, edge, parent, child, siblings, leaf, degree, level, height, depth, path and subtree · Easy
What is a tree node with no children called?
Not quite. Try another option.
Answer: A leaf node
A leaf is a node that does not have any child nodes.
Question 14 of 60 · Tree terminology: root, edge, parent, child, siblings, leaf, degree, level, height, depth, path and subtree · Easy
What are two nodes with the same parent called?
Not quite. Try another option.
Answer: Siblings
Nodes that share the same parent are called siblings.
Question 15 of 60 · Tree terminology: root, edge, parent, child, siblings, leaf, degree, level, height, depth, path and subtree · Easy
What is an edge in a tree?
Not quite. Try another option.
Answer: A connection between two nodes
An edge is the link that connects one tree node to another.
Question 16 of 60 · Conceptual understanding of binary trees · Easy
What is the maximum number of children that a node in a binary tree can have?
Not quite. Try another option.
Answer: Two
Each node in a binary tree can have at most two children.
Question 17 of 60 · Conceptual understanding of binary search trees · Easy
In a binary search tree, where are values smaller than a node usually placed?
Not quite. Try another option.
Answer: In its left subtree
A binary search tree places smaller values in the left subtree and larger values in the right subtree.
Question 18 of 60 · Preorder traversal · Easy
Which order is used in preorder traversal?
Not quite. Try another option.
Answer: Root, left, right
Preorder traversal visits the root first, followed by the left subtree and then the right subtree.
Question 19 of 60 · Inorder traversal · Easy
Which order is used in inorder traversal?
Not quite. Try another option.
Answer: Left, root, right
Inorder traversal visits the left subtree, then the root, and finally the right subtree.
Question 20 of 60 · Postorder traversal · Easy
Which order is used in postorder traversal?
Not quite. Try another option.
Answer: Left, right, root
Postorder traversal visits the left subtree, then the right subtree, and the root last.
Question 21 of 60 · Definition of linked list · Medium
A program frequently inserts records after a known record. Why may a linked list be more suitable than an array?
Not quite. Try another option.
Answer: Insertion can be performed by changing links without shifting later records.
Once the insertion position is known, a linked list inserts a node by updating links rather than shifting subsequent elements.
Question 22 of 60 · Implementation of singly linked list · Medium
Which structure correctly represents a node in a singly linked list of integers?
Not quite. Try another option.
Answer: An integer data field and a pointer to the next node
A singly linked list node stores its data and one link to the next node.
Question 23 of 60 · Singly linked list traversal · Medium
For the list 8 → 3 → 6 → null, what is printed by a traversal that starts at head and prints each node before advancing to next?
Not quite. Try another option.
Answer: 8 3 6
Traversal follows each next link from the head, so the nodes are visited in list order.
Question 24 of 60 · Singly linked list traversal · Medium
In a nonempty singly linked list, the loop while (current.next != null) current = current.next; terminates with current pointing to which node?
Not quite. Try another option.
Answer: The last node
The loop stops when current.next is null, which is the defining condition of the last node.
Question 25 of 60 · Singly linked list insertion · Medium
Which sequence correctly inserts newNode at the beginning of a singly linked list?
Not quite. Try another option.
Answer: newNode.next = head; head = newNode;
The new node must first link to the old head, after which head is updated to the new node.
Question 26 of 60 · Singly linked list insertion · Medium
Suppose p points to a node in a singly linked list. Which statements correctly insert newNode immediately after p without losing the remaining list?
Not quite. Try another option.
Answer: newNode.next = p.next; p.next = newNode;
The new node first stores the old successor of p, and then p is linked to the new node.
Question 27 of 60 · Singly linked list deletion · Medium
Which operation correctly deletes the first node of a nonempty singly linked list while allowing its memory to be released?
Not quite. Try another option.
Answer: temp = head; head = head.next; free(temp);
The old head is saved, head advances to the second node, and the removed node is then released.
Question 28 of 60 · Singly linked list deletion · Medium
If q = p.next and q is not null, which statements delete q from the list?
Not quite. Try another option.
Answer: p.next = q.next; free(q);
Linking p to the node after q bypasses q, which can then be safely released.
Question 29 of 60 · Linked list underflow and overflow conditions · Medium
A deletion is requested when head is null. Which condition has occurred?
Not quite. Try another option.
Answer: Linked list underflow
Underflow occurs when deletion or access is attempted on an empty linked list.
Question 30 of 60 · Linked list underflow and overflow conditions · Medium
When does linked list overflow normally occur in a dynamically allocated implementation?
Not quite. Try another option.
Answer: When memory allocation for a new node fails
A dynamic linked list overflows when the system cannot provide memory for another node.
Question 31 of 60 · Introduction to trees · Medium
A valid tree contains nodes. How many edges does it contain?
Not quite. Try another option.
Answer:
A tree with nodes has exactly edges, so it has edges.
Question 32 of 60 · Tree terminology: root, edge, parent, child, siblings, leaf, degree, level, height, depth, path and subtree · Medium
In a tree, root R has children A, B, and C; node A has children D and E. Which statement is correct?
Not quite. Try another option.
Answer: D and E are siblings, and the degree of R is 3.
D and E share parent A, while R has three children and therefore has degree 3.
Question 33 of 60 · Tree terminology: root, edge, parent, child, siblings, leaf, degree, level, height, depth, path and subtree · Medium
Using edges as the measure, a deepest leaf is reached from the root through three edges. What are the depth of that leaf and the height of the tree?
Not quite. Try another option.
Answer: Depth 3 and height 3
The leaf's depth is its distance from the root, and the tree's height is the greatest leaf depth; both are 3 edges.
Question 34 of 60 · Tree terminology: root, edge, parent, child, siblings, leaf, degree, level, height, depth, path and subtree · Medium
If node X and all nodes descended from X are considered together, what do they form?
Not quite. Try another option.
Answer: A subtree rooted at X
A node together with all of its descendants forms a subtree whose root is that node.
Question 35 of 60 · Conceptual understanding of binary trees · Medium
If the root is at level , what is the maximum number of nodes at level of a binary tree?
Not quite. Try another option.
Answer:
A binary tree can have at most nodes at level , so level can contain nodes.
Question 36 of 60 · Conceptual understanding of binary trees · Medium
Which statement must be true for every binary tree?
Not quite. Try another option.
Answer: Each node has at most two children.
The defining property of a binary tree is that no node has more than two children; ordering and balance are not required.
Question 37 of 60 · Conceptual understanding of binary search trees · Medium
The keys 50, 30, 70, 20, 40, 60 are inserted into an empty binary search tree in that order. Where will key 65 be inserted?
Not quite. Try another option.
Answer: As the right child of 60
65 is greater than 50, less than 70, and greater than 60, so it becomes the right child of 60.
Question 38 of 60 · Conceptual understanding of binary search trees · Medium
A binary search tree has root 40; its right child is 60, whose left child is 50. Which comparison path is followed when searching for 50?
Not quite. Try another option.
Answer: 40 → 60 → 50
Because , the search moves right to 60; because , it then moves left to 50.
Question 39 of 60 · Preorder traversal · Medium
A binary tree has root A; A has children B and C; B has children D and E; and C has right child F. What is its preorder traversal?
Not quite. Try another option.
Answer: A, B, D, E, C, F
Preorder visits the root, then the left subtree, and then the right subtree.
Question 40 of 60 · Inorder traversal · Medium
A binary tree has root A; A has children B and C; B has children D and E; and C has right child F. What is its inorder traversal?
Not quite. Try another option.
Answer: D, B, E, A, C, F
Inorder visits the left subtree, the root, and then the right subtree.
Question 41 of 60 · Definition of linked list · Hard
A singly linked list is represented by head = 900, with nodes (900: A, 300), (300: B, 700), and (700: C, NULL), where each pair after the address stores (data, next). If the node at address 300 is relocated to address 500, which change preserves the same logical list?
Not quite. Try another option.
Answer: Change the next field at address 900 from 300 to 500
The node containing A points to the relocated node. Its link must be updated, while the head and the relocated node's link to 700 remain unchanged.
Question 42 of 60 · Implementation of singly linked list · Hard
Assume n is a newly allocated node and head points to the first node of a possibly nonempty singly linked list. Which ordering correctly inserts n at the front without losing access to the original list?
Not quite. Try another option.
Answer: n->next = head; head = n;
The new node must first store the old head address. Only then can head be redirected to the new node.
Question 43 of 60 · Singly linked list traversal · Hard
A singly linked structure may end in NULL or may contain a cycle. Which traversal strategy guarantees that every reachable node is processed exactly once and that traversal terminates in both cases?
Not quite. Try another option.
Answer: Store visited node addresses and stop before processing a repeated address
Tracking addresses distinguishes previously visited nodes from new ones. It terminates at either NULL or the first repeated node in a cycle.
Question 44 of 60 · Singly linked list insertion · Hard
A sentinel-headed singly linked list is sorted in ascending order. A new value x must be inserted after all existing nodes equal to x. Starting with p at the sentinel, which loop finds the correct predecessor?
Not quite. Try another option.
Answer: while (p->next != NULL && p->next->data <= x) p = p->next;
Advancing while the next value is less than or equal to x places p after every existing occurrence of x.
Question 45 of 60 · Singly linked list insertion · Hard
A singly linked list maintains both head and tail. Which operation correctly appends a new node n and preserves head == tail for a one-node list?
Not quite. Try another option.
Answer: Set n->next = NULL; if empty set head = tail = n, otherwise link tail->next = n and set tail = n
An empty list requires both pointers to reference n. Otherwise, the old tail links to n, which becomes the new tail.
Question 46 of 60 · Singly linked list deletion · Hard
Only a pointer p to a non-tail node of a singly linked list is available; neither head nor the predecessor is available. Assuming node identity need not be preserved, how can the logical element at p be deleted in time?
Not quite. Try another option.
Answer: Copy the successor's data into p, bypass the successor, and free the successor
Because p has a successor, its successor's contents can replace its logical contents. The successor is then unlinked and freed.
Question 47 of 60 · Singly linked list deletion · Hard
The following pointer-to-pointer algorithm deletes every node whose data equals x: Node **link = &head; while (*link != NULL) { if ((*link)->data == x) { Node *t = *link; *link = t->next; free(t); } else { /* missing */ } }. Which statement correctly replaces the missing part?
Not quite. Try another option.
Answer: link = &(*link)->next;
When no deletion occurs, link must advance to the address of the current node's next field. After deletion it must not advance, allowing consecutive matches to be removed.
Question 48 of 60 · Linked list underflow and overflow conditions · Hard
For a dynamically allocated linked-list stack with no imposed size limit, which pair most accurately describes underflow and overflow?
Not quite. Try another option.
Answer: Underflow occurs when popping an empty list; overflow occurs when node allocation fails
A linked structure has no fixed-capacity boundary. It underflows on removal from an empty list and overflows only when another node cannot be allocated.
Question 49 of 60 · Introduction to trees · Hard
A connected undirected tree has vertices. One new edge is added between two distinct existing vertices. Which statement must then be true?
Not quite. Try another option.
Answer: The graph has edges and contains exactly one cycle
A tree initially has edges and a unique path between every pair of vertices. The added edge closes exactly one such path into a cycle.
Question 50 of 60 · Tree terminology: root, edge, parent, child, siblings, leaf, degree, level, height, depth, path and subtree · Hard
A rooted tree has edges R-A, R-B, R-C, A-D, A-E, B-F, E-G, F-H, and F-I. Levels begin at , and height is measured in edges. Which description is correct?
Not quite. Try another option.
Answer: R has degree , E has depth , and the tree has height
R has children A, B, and C. The path from R to E has two edges, while paths such as R-A-E-G establish height .
Question 51 of 60 · Tree terminology: root, edge, parent, child, siblings, leaf, degree, level, height, depth, path and subtree · Hard
A rooted tree contains nodes and leaves. Every nonleaf node has either one child or three children. How many nodes have degree three?
Not quite. Try another option.
Answer: nodes
There are nonleaves. If and counts the tree's edges, then nodes have three children.
Question 52 of 60 · Tree terminology: root, edge, parent, child, siblings, leaf, degree, level, height, depth, path and subtree · Hard
A rooted tree has edges R-A, R-B, A-C, A-D, D-E, B-F, F-G, and F-H. Which tuple correctly gives (number of nodes in the subtree rooted at D, length of the path from E to G, lowest common ancestor of E and G)?
Not quite. Try another option.
Answer:
The subtree contains D and E. The path E-D-A-R-B-F-G has six edges, and the first common ancestor is R.
Question 53 of 60 · Conceptual understanding of binary trees · Hard
The height of a binary tree is measured as the number of edges on its longest root-to-leaf path. What is the minimum possible height of a binary tree containing nodes?
Not quite. Try another option.
Answer:
A height- binary tree contains at most nodes. Height holds at most , while height can hold up to .
Question 54 of 60 · Conceptual understanding of binary trees · Hard
A complete binary tree contains nodes numbered from in level order. How many leaves and how many nodes with exactly one child does it contain?
Not quite. Try another option.
Answer: leaves and node with exactly one child
Nodes through are leaves. Node has only child , while nodes through each have two children.
Question 55 of 60 · Conceptual understanding of binary search trees · Hard
Assume all keys are distinct. Which sequence can be the preorder traversal of a binary search tree?
Not quite. Try another option.
Answer: 40, 30, 20, 35, 60, 50, 70
The sequence respects the valid key range for each subtree. Each distractor returns to a key range that preorder traversal has already completed.
Question 56 of 60 · Conceptual understanding of binary search trees · Hard
Keys 50, 30, 70, 20, 40, 60, 80, 65 are inserted in that order into an empty binary search tree. Node 70 is then deleted using its inorder successor. What is the resulting preorder traversal?
Not quite. Try another option.
Answer: 50, 30, 20, 40, 80, 60, 65
The inorder successor of 70 is 80. It replaces 70, with the subtree rooted at 60 remaining as its left subtree.
Question 57 of 60 · Preorder traversal · Hard
A binary tree has preorder A, B, D, E, C, F, G and inorder D, B, E, A, F, G, C. What is the preorder traversal of its mirror tree, obtained by swapping the left and right children of every node?
Not quite. Try another option.
Answer: A, C, F, G, B, E, D
The original root has subtrees rooted at B and C. Mirroring visits the mirrored C subtree first, followed by the mirrored B subtree.
Question 58 of 60 · Inorder traversal · Hard
A full binary tree with distinct labels has preorder A, B, D, E, C, F, G and postorder D, E, B, F, G, C, A. What is its inorder traversal?
Not quite. Try another option.
Answer: D, B, E, A, F, C, G
The full-tree condition determines B and C as the two subtree roots, with leaves D, E and F, G respectively.
Question 59 of 60 · Postorder traversal · Hard
A binary tree has preorder K, D, B, F, E, H, M, L, P and inorder B, D, E, F, H, K, L, M, P. What is its postorder traversal?
Not quite. Try another option.
Answer: B, E, H, F, D, L, P, M, K
The left subtree is rooted at D and yields B, E, H, F, D; the right subtree is rooted at M and yields L, P, M. The root K is last.
Question 60 of 60 · Postorder traversal · Hard
Keys 45, 25, 65, 15, 35, 55, 75, 30, 40, 70 are inserted into an empty binary search tree in that order. Which sequence is its postorder traversal?
Not quite. Try another option.
Answer: 15, 30, 40, 35, 25, 55, 70, 75, 65, 45
Postorder visits each left subtree, then right subtree, then root. The subtrees rooted at 25 and 65 are completed before the root 45.
That's unit 3
Answer a few questions and your score shows up here.
Nearly through. Did unit 3 of INT322 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 3 of INT322 save you a night before the exam?
Then you can help keep it free for the next batch. Ads cover part of the server bill;
the rest comes out of a student's own pocket: the domain, the storage, and keeping
the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.