1 - Static methods and variables are associated with the...

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

View Full Document Right Arrow Icon
- Static methods and variables are associated with the class itself and are called instance methods and instan variables - The combination of data and related operations is called information hiding principle 2. Which of the following keywords are access modifier: - Protected - Private 3. Select correct statements: - Subclasses or derived classes inherit the fields and methods from their base class - An abstract data type can be part of a program in the form of an interface 4. Which of the following statements are true: - AN object can be saved in a life if its class type is stated to implement in the Serializable interface - If the vector’s capacity is greater than its size, then a new element can be inserted at the end of the vector immediately 5. Which of sentences about singly linked list are true: - Deleting a node at the beginning of the list takes constant time O(1) - On the average, delete operation executes O(n) steps - There is no immediate access to the predecessor of any node in list 6. Select correct statement(s) about Doubly Linked List: - The node which is deleted from the list will be claimed by the garbage collection - Deleting a node at the end of the list takes constant time O(1) - Processing for adding a node to the end of list includes six steps 7. Select incorrect statements about skip list: - None of the others: + In a skip list of n nodes, for each k and I such that and , the node in positi 2 k-1 .i points to the node in position 2 k-1 .(i+1) + The number of reference fields indicates the level of each node, and the number of levels is maxLevel = 8. Select incorrect statement about skip list: - The search time is O(lgn) in the worst case - In 20-element skip lists, the node in position 3 points to the node in position 7 9. Select false statement: - In the array list, poping is executed in O(lgn) to the worst case 10. Select true statements about stack: - The Java implementation of the stack is potentially fatal - Stack can be implemented by linked list 11. Which of the following methods of queue are true: - isEmpty() – Check to see if the queue is empty - enqueue(el) – Put the element el at the end of the queue - firstEl() – Return the first element in the queue without removing it 12. Which of the following can be executed in constant time O(n) - When deleting a node of a singly linked list in the average case - When deleting a node of a singly linked list in the worst case 13. Which of the following statements are true:
Image of page 1

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

View Full Document Right Arrow Icon
- The recursive version increases program readability, improves self-documentation and simplifies coding 14. When converting a method from a recursive version into an iterative version, - The brevity of program formulation lost. However, the brevity may not be an issue in Java - Program clarity can be diminished 15. Recursive definitions on most computers are eventually implemented using a run-time stack and this implementation is done by the operating system.
Image of page 2
Image of page 3
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