Study Guide for CS 312 Test 2 (Spring 2013)
* Write methods with their proper signatures (headers) for problems
that have input parameters with Strings and arrays as well as
return Strings and arrays.
* Use methods that someone has already written, in a method of
your own.
* Use methods in the Arrays class.
* Given a recursive method you should be able to tell me what the
output will be for a given set of its input parameter(s) and write
an iterative version for the method by looking at its output.
* Use the recursive code given in class to perform permutations.
* These are methods that you should be able to write using 1-dimensional
arrays:
- find the max and min elements in the array
- find the second highest element in an array
- search for an element in an unsorted or sorted array
- merge two sorted arrays
- add two arrays together
- multiply corresponding elements in two arrays and return the sum
- determine if two arrays are equal
- determine if an array is sorted (either in ascending or descending order)
- sort an array
- return an array that has the cummulative sum of another array
- reverse the elements of an array in place
- remove duplicate elements in an array
* These are methods that you should be able to write using 2-dimensional
arrays:
- find the max and min elements in the array
- search for an element in the array
- find the sum of a particular row in the array
- find the sum of a particular column in the array
- find the sum of any diagonal in the array
- find the sum of two 2-dimensional arrays
- reverse either the rows or the columns in a 2-D array
- transpose a 2-D array
- perform a matrix multiplication
* These are the methods in the String class that you should be familiar
with:
- length()
- equals()
- equalsIgnoreCase()
- compareTo()
- charAt()
- indexOf()
- substring()
- split()
* These are the methods in the StringBuffer class that you should be
familiar with:
- append()
- insert()
- delete()
- replace()
- reverse()
- toString()
* Be familiar with the algorithms on sorting, searching, and merging.
* You should also be able to open a text file for reading or open
a text file for writing.
There will be no surprises in the test. It will be strictly based on the
topics mentioned in this study guide. The best way to prepare yourself
for the test is to write short programs that fulfill the requirements of
the bulleted items. Practice using the problems giving in LiveLab and
Coding Bat.