Review Sheet CS 110 Exam 3 I Terms for DEFINITIONS no matching array index uninitialized array exception base case indirect recursion assertion one dimensional array upper bounds row processing try catch general case tail recursion two dimensional array lower bounds column processing recursion direct recursion activation record II Topic Arrays o You will need to know how to declare initialize and use arrays o You will need to know the various forms that can be used to declare arrays o You will need to understand that arrays are all instances of class Arrays and the various operations provided by class Arrays o You will need to be able to write code containing loops that manipulate array contents o You will need to understand what is meant by the upper and lower bounds of an array o You will need to know how to initialize all of the values in an array to the same value o You will need to understand how to READ and WRITE both standard for loops and collection based for loops that manipulate the contents of an array o You will need to understand how to declare two dimensional arrays o You will need to understand how to specify the index of an element in both a one dimensional array and a two dimensional array o You will need to be able to implement the bubble sort algorithm and diagnose errors in code that implements a bubble sort o You will need to be able to implement the insertion sort algorithm and diagnose errors in code that implements a insertion sort o You will need to be able to implement the selection sort algorithm and diagnose errors in code that implements a selection sort o IN TEST3 you will write or trace through code that manipulates multidimensional arrays You should understand project 5 on class matrix and perhaps implement another method for you r class You should be able two write methods that manipulate specific columns and rows of a 2 D array FILE I O Exceptions o You will need to be able to write a try catch block to read text data from a simple text file o You should be able to explain the purpose of the try catch block o you should be able to explain the purpose of the throws specifier I O in general IN THIS EXAM IF YOUR CODE RECEIVES KEYBOARD INPUT YOU MUST USE THE CORRECT METHOD NAMES REVIEW CLASS SCANNER AND READITEM RECURSION o You should be able to define and explain recursion o Given a recursive method you should be able to trace the execution of the method o Give a problem you should be able to implement a recursive method o Give a recursive method you should be able to identify the range of valid values that the method can receive o You should be able to compare recursion to iteration Searching o Be able to explain and write a bubble sort for arrays with a variety of different types of elements o You will need to be able to diagnose errors in code that implements a bubble sort o Be able to explain and write the linear search algorithm o Be able to explain and write a binary search algorithm using loops or recursion o Explain why the binary search is faster than the linear search o For a give array explain the maximum number of probes for both algorithms Assertionso You should be able to explain what assertions are and when to use them o Given a simple method be able to write assertions
View Full Document
Unlocking...