



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




First Name: _______________________ Last Name: _______________________ Student ID: _______________________ Section time ___________ TA: __________________________ I pledge on my honor that I have not given or received any unauthorized assistance on this examination. Your signature: _____________________________________________________________ General Rules (Read): This exam is closed book and closed notes. If you have a question, please raise your hand. Total point value is 80 points. Answer True/False questions by circling the T or F at the end of the question. Answer essay questions concisely using 1 or 2 sentences. Longer answers are not necessary and are discouraged. WRITE NEATLY. If we cannot understand your answer, we will not grade it (i.e., 0 credit). Honors section questions only count for credit for students in the honors section. Grader Use Only: #1 (13) #2 (9) #3 (7) #4 (6) #5 (12) #6 (15) #7 (18) Total (80) Honors (20)
c. Write a recursive function to compare two array of ints, returning true if the arrays have the same elements and in the same order. Assume neither a nor b are null. The static method sameArray has the following prototype: public static boolean sameArray (int[ ] a , int[ ] b ) Feel free to add an auxiliary method. Non-recursive solutions will receive no credit.
b. Use the generic Node class to build a generic myQueue class that supports i. Constructor for empty myQueue( ) ii. Enqueue( ) method for adding element to queue iii. Dequeue( ) method for removing element from queue
Honors Section – Credit is given only for Honors Section students!