Linked List

22 Questions | Total Attempts: 1392

SettingsSettingsSettings
Please wait...
Database Quizzes & Trivia

Related Topics
Questions and Answers
  • 1. 
    What are the basic components of a linked list?
    • A. 

      Head and tail are the only important components

    • B. 

      Data members for the information to be stored and a link to the next item

    • C. 

      Generic class because without this linked list is not possible

  • 2. 
    • A. 

      To store the information and the link to the next item

    • B. 

      To check for the end of the list

    • C. 

      Not used in a linked list

  • 3. 
    A linked list is different from an array, because why?
    • A. 

      A linked list can handle more types of information than an array

    • B. 

      An array cannot be sorted but a linked list can be

    • C. 

      An array is fixed in size but a linked list is dynamically sizable

  • 4. 
    In addition to the info and link components, the linked list must also contain what other components?
    • A. 

      Sorting information about the list

    • B. 

      Head and tail pointers to the first and last nodes

    • C. 

      The current node that was last accessed

  • 5. 
    What is the proper code for accessing the information of the second item in a linked list?
    • A. 

      Head.info

    • B. 

      Head.link.info

    • C. 

      Head.link.link.info

  • 6. 
    • A. 

      A linked list becase of the nodes

    • B. 

      An array because of the reduced code and efficient storage allocation

    • C. 

      Neither is more efficient over the other

  • 7. 
    A linked list class is defined with the following heading. public class UnorderedLinkedList<T> extends LinkedListClass<T> What is the proper syntax for creating an reference variable of the linked list to hold strings?
    • A. 

      LinkedListClass list;

    • B. 

      UnorderedLinkedList list;

    • C. 

      List = UnorderedLinkedList(String)

  • 8. 
    What does the following fragment of code do with a linked list? current = head; while (current != null) { current = current.link; }
    • A. 

      It initializes the list

    • B. 

      It counts the number of items in the list

    • C. 

      It traverses the list

  • 9. 
    • A. 

      Code A

    • B. 

      Code B

    • C. 

      Code C

    • D. 

      Code B and C

  • 10. 
    Internally, a linked list is implemented with an array for the storage of the information?
    • A. 

      True

    • B. 

      False

  • 11. 
    A linked list must contain a maximum size component to managed the last item?
    • A. 

      True

    • B. 

      False

  • 12. 
    Which of the following code fragments properly delete the item at node p? A) p.link = null; System.gc(); B) q = p.link; p.link = q.link; q = null; System.gc(); C) q = p.link; p.link = q.link; System.gc();
    • A. 

      Code A

    • B. 

      Code B

    • C. 

      Code C

  • 13. 
    • A. 

      The forward list uses the unordered linked list and backwards uses the ordered linked list

    • B. 

      Nothing, only the insertion of the information at the head or tail of the linked list

    • C. 

      The head and tail are reversed definitions in the backwards list

  • 14. 
    What does ADT stand for?
    • A. 

      Automatic Data Template

    • B. 

      Anonomous Data Template

    • C. 

      Abstract Data Type

  • 15. 
    • A. 

      To unnecessarily complicate the design

    • B. 

      Using an abstract data type is the only method for building linked lists

    • C. 

      To force a specific set of methods to be used for the subclasses

  • 16. 
    What does the following code represent? public interface LinkedListADT<T> extends Cloneable
    • A. 

      A linked list class ready to be used in a program

    • B. 

      An abstract method used in a linked list class

    • C. 

      An abstract class used to further define a linked list class

  • 17. 
    The following heading appears for the node class of a linked list class. protected class LInkedListNode<T> implements Cloneable What is the proper syntax for the link component of this class?
    • A. 

      Public LinkedListNode link;

    • B. 

      Protected LinkedListNode link;

    • C. 

      Public T link;

    • D. 

      First and second choices above

  • 18. 
    The instance variables first and last (or head and tail) below to which class of a linked list?
    • A. 

      Class LinkedListNode

    • B. 

      Class LinkedListADT

    • C. 

      Class LinkedListClass

  • 19. 
    What should the default constructor of the LinkedListClass perform?
    • A. 

      Nothing since the LinkedListNode class will take care of initialization

    • B. 

      Initialize the first and last (or head and tail) and set count to zero

    • C. 

      Initialize the array to store the information in the linked list

  • 20. 
    Which methods are unique between an UnorderedLinkedList and OrderedLinkedList classes?
    • A. 

      Search(T item); insertFirst(T item); insertLast(T item); and deleteNode(T item);

    • B. 

      Front(); back(); and initializeList();

    • C. 

      None of the above

  • 21. 
    How does a doubly linked list (DLL) compare to the single linked list (SLL)?
    • A. 

      A DLL will traverse the list much faster than a SLL because of the extra links

    • B. 

      A DLL has two links for traversing the list but does not execute faster when traversing

    • C. 

      None of the above

  • 22. 
    What is a circular linked list?
    • A. 

      The last node in the linked list points to the first

    • B. 

      The last node in the linked list points to itself

    • C. 

      A specialized linked list for storing geometic information such as circles