Final Exam Review - Final Exam Review December 8 2010 CS...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Page 1 of 14 Final Exam Review CS 1332 December 8, 2010 Fall 2010 This list of practice problems should not be considered exhaustive. Anything covered in lecture and/or recitation is fair game. 1. Big-O Matching. Write the number corresponding to a time complexity next to each algorithm or operation. 1. O(1) 2. O(log n ) 3. O( n ) 4. O( n log n ) 5. O( n 2 ) a. ______ Bubble Sort b. ______ Heap Sort c. ______ Insertion Sort d. ______ Merge Sort e. ______ Quicksort f. ______ Radix Sort g. ______ Selection Sort h. ______ Binary Search i. ______ Linear Search j. ______ Insert into BST k. ______ Remove from BST l. ______ Insert into AVL Tree m. ______ Insert into Heap n. ______ Remove from Heap o. ______ Insert into Perfect Hash Table 2. Interfaces. Write the method signatures and return types for the methods in each interface. Some blanks may not be used. a. Comparable<E> public ________ _______________ (___________________); b. Iterable<E> public ________ _______________ (___________________); c. Iterator<E> public ________ _______________ (___________________); public ________ _______________ (___________________); public ________ _______________ (___________________);
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CS 1332 Final Review Fall 2010 Page 2 of 14 3. Constructor Chaining, Method Overriding. Assume each of the following three classes is in a separate file. In the space below the code, write what is displayed when the main method is executed. public class Top { public Top() { System.out.println("In Top"); myMethod(); } public void myMethod() { System.out.println("Top's myMethod"); } } public class Middle extends Top { public Middle(String string) { System.out.println("In Middle - " + string); } public void myMethod(String string) { System.out.println("Middle's myMethod"); } } public class Bottom extends Middle { public Bottom(String string) { super(string); System.out.println("In Bottom - " + string); } public void myMethod() { super.myMethod(); System.out.println("Bottom's myMethod"); } public static void main(String[] args) { Top middle = new Bottom("I love CS 1332!"); } }
Image of page 2
CS 1332 Final Review Fall 2010 Page 3 of 14 4. Linked Lists. Below is the skeleton of a linked list. Complete the method to remove the node at an index. You may not add or change any methods, fields, classes, etc.
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern