StudyBrix / Subjects / Computer science / Data structures Subjects
Data structures Choose questions individually, practise online, or create a worksheet with matching answers. Counts include generated variants, not only authored originals.
Sample exercises University · Data structures Which input condition does ordinary binary search require? A sorted sequence under the comparison rule Any unsorted sequence Only positive values No duplicate values in every variant Answer and explanation A sorted sequence under the comparison rule
Ordering enables discarding half the interval safely.
University · Data structures A procedure performs exactly 3n+2 operations in a stated model. Find the count for n=10. Answer and explanation 32
3×10+2=32.
University · Data structures What does a loop invariant describe? A condition preserved at a specified loop point The processor brand A random input guess Only the final printed word Answer and explanation A condition preserved at a specified loop point
Initialization, preservation and termination connect the invariant to correctness.
University · Data structures An interval of 64 candidates is halved exactly three times. How many remain? Answer and explanation 8
64/2³=8.
University · Data structures Why does O(n) not tell us an exact runtime in seconds? Answer and explanation It describes asymptotic growth under a cost model, while constants, hardware, implementation and input details affect wall-clock time.
Credit growth versus measured runtime.
University · Data structures Which is an important test input for a search function? Only a screenshot Only a large output font An empty collection Only one usual successful case Answer and explanation An empty collection
Boundary cases can reveal indexing and termination bugs.
Study notes An algorithm should have a stated input contract, output goal and termination argument. A loop invariant describes what remains true at a defined point in each iteration.
University An algorithm should have a stated input contract, output goal and termination argument. A loop invariant describes what remains true at a defined point in each iteration.
University An ordered mutable collection addressed by position.
University An ordered mutable collection addressed by position.
University The array is sorted and balanced median choices are used. Count inspected elements, including the last one.
Grades 9–12 The array is sorted and balanced median choices are used. Count inspected elements, including the last one.
Grades 9–12 Related courses Computer science4 lessons Learn core Python concepts with paper-based reasoning and small code-reading tasks.
32 quiz questions · University
Computer science4 lessons Study HTML, CSS, JavaScript and accessible web structure without a paid bootcamp.
32 quiz questions · University
Computer science4 lessons Learn tables, queries, joins and data modelling with original exercises.
32 quiz questions · University
Computer science4 lessons Work through data cleaning, visualization, modelling and interpretation.
32 quiz questions · University
Computer science4 lessons Study defensive security, privacy and risk management without offensive exploitation instructions.
32 quiz questions · University
Computer science4 lessons Learn formulas, references, cleaning and charts for practical study and office work.
32 quiz questions · University