Comp 121

Chapter 7 Study Guide

Chapter 7

 

What is a one-dimensional array? What is the general form of an array declaration statement?

 

What is each item in the array called? What is its index or subscript value?

 

If grade is an array and j is an int variable, is grade[j*3] a valid subscripted variable? Why or why not?

 

What is the format to initialize an array within its declaration statement?

 

If the following line is used to create array code:

char code[] = "sample";

then what is the value of code[2]? What is the length of code?

 

Can an individual array element be passed to a called function? How is this done? When a complete array of values is passed to a function, does the function receive a copy of the values or access to the actual array?

 

In the parameter declarations, is the size of the array needed? Specifically, is the following function header valid:

int findMax(int vals[])

 

What is a two-dimensional array? What is another name for it? How is a two-dimensional array declared?

 

How is a two-dimensional array initialized from within its declaration statement?

 

If val is a two-dimensional array, the element held at val[2][3] has what row position and what column position?

 

How would a 4-dimension array be declared?

 

What is the difference between a linear search and a binary search? Which search is faster?

 

What is Big O Notation used for?

 

What is a sorting algorithm?