Difficulty: Easy
Correct Answer: Insert
Explanation:
Introduction / Context:
Lists (arrays, linked lists, dynamic lists) support a small set of fundamental operations. Understanding how each operation affects list length is essential when analyzing time/space complexity and ensuring algorithms maintain correct invariants.
Given Data / Assumptions:
Concept / Approach:
Insert adds a new element; by definition, it increases the number of elements by one (or more if bulk-insert). Look-up retrieves an element without changing the structure; modify updates content of an existing element at a position, leaving length unchanged. Therefore, only insertion increases length, assuming no simultaneous deletion.
Step-by-Step Solution:
Verification / Alternative check:
In dynamic arrays (e.g., vectors), insert may trigger resizing but still increases logical length by 1. In linked lists, inserting a node increases node count by 1, confirming the rule across implementations.
Why Other Options Are Wrong:
Common Pitfalls:
Confusing append/concatenate (which are forms of insert) with modify; or assuming search that adds to a cache alters the list being queried (it does not, unless explicitly designed).
Final Answer:
Insert
Discussion & Comments