Assignment in Data Structure and Algorithm
Data Storage Basics
What is the fundamental way data is stored in computers?
Why do most modern programming languages use higher-level objects instead of dealing
directly with bits?
Arrays
Define an array in the context of computer science.
How are items in an array typically stored in computer memory?
Provide an example of an array of integers and write it in proper notation.
Explain the concept of array indexing. How does it differ from everyday counting?
What is the size of an array, and how is it determined?
What does the notation a[5] mean in the context of arrays?
Array Operations
How are individual items in an array accessed?
Describe two methods of moving through an array.
Loops and Iteration
What is the purpose of a loop in programming?
Provide an example of a for-loop in pseudocode and in a programming language like C or
Java.
What are the four main parts of a for-loop structure?
Explain the process of computing the sum of elements in an array using a for-loop.
What does iteration over an index mean?
Loop Structure
Break down the general for-loop structure into its components.
Explain the role of each component in the for-loop structure.
Invariants
Define an invariant in the context of algorithms.
Why are invariants important for data structures and algorithms?
What is a loop invariant?
Provide an example of a loop invariant in a procedure that finds the minimum value in an
array.
How does a loop invariant help in proving the correctness of an algorithm?