100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4,6 TrustPilot
logo-home
Examen

COSC-2336 Collections - Programming Fundamentals III Final Exam Correct Questions and Answers 100% A+ Graded

Puntuación
-
Vendido
-
Páginas
28
Grado
A+
Subido en
28-05-2024
Escrito en
2023/2024

COSC-2336 Collections - Programming Fundamentals III Final Exam Correct Questions and Answers 100% A+ Graded A list in which each stored element is associated with a reference to its successor is called - CORRECT ANSWER-a linked list To allocate storage for its elements, an array-based list such as ArrayList uses - CORRECT ANSWER-contiguous allocation To allocate storage for their elements, linked lists use - CORRECT ANSWER-linked allocation A linked list is represented by a reference to - CORRECT ANSWER-the first node in the list, unless the list is empty, in which case the reference is set to null A Node class for a linked list that can hold elements of type Object can be declared to have fields - CORRECT ANSWER-Object element; Node next; In a linked list, the predecessor of a node X - CORRECT ANSWER-is undefined if X is the first node, otherwise it is the node whose index is one less than the index of X The objects that form the units of memory allocation in a linked lists are called - CORRECT ANSWER-nodes To remove the first node in a nonempty linked list, - CORRECT ANSWER-move the head reference one node forward: head = ; A systematic procedure for starting at the first node in a list, and visiting all nodes in the list by going from each node to its successor is called - CORRECT ANSWER-a traversal In a linked list implementation using a reference first to point to the first node of the list, a method isEmpty() can test to see if the list is empty by executing the statement(s) - CORRECT ANSWER-return first == null; A list method void add(int index, E x) seeking to add an element x that is an object of a class E to a list, should throw an IndexOutOfBoundsException when - CORRECT ANSWER-the index is negative, or greater than the size of the list A method int size( ) in a linked list class returns the number of elements stored in the list by executing the single statement return count; For this to work correctly, - CORRECT ANSWER-It is not possible for size to just return the count value: the size method must set count to 0 and then increment count once for each element in the list. A linked list class keeps its elements in the order in which they are added, with the index of an element X being greater than the index of any element added to the list before X. Addition of new elements to such a list can be made more efficient - CORRECT ANSWER-none of the above A list method E remove(int index) designed to remove and return the element at the given index should throw IndexOutOfBoundsException when - CORRECT ANSWER-the index is negative, or is greater than, or equal to, the size of the list A doubly linked list makes it easy to - CORRECT ANSWER-move from any node to its successor, and from any node to its predecessor A circularly linked list makes it easy to - CORRECT ANSWER-jump from the last node to the first In a typical circular doubly linked list, a node has - CORRECT ANSWER-a field to store the element, and two references to keep track of successor and predecessor nodes A list can be considered a recursive data structure because - CORRECT ANSWER-if you remove the head of the list, what remains is also a list The tail of a list - CORRECT ANSWER-is what you get when take a list and remove its head When using recursion on linked lists - CORRECT ANSWER-the recursive method should be made private, and should be called by a public non-recursive method A Java collection - CORRECT ANSWER-is an object that is is used as a container for other objects The three major categories of Java collections are - CORRECT ANSWER-lists, sets, and maps A collection that stores its elements in an (ordered) sequence, and allows access to each element by its position in the sequence is called a - CORRECT ANSWER-list A collection that does not impose a positional order on its elements, and does not allow duplicates is called a - CORRECT ANSWER-set A collection whose elements are pairs of keys and values is called - CORRECT ANSWER-a map Which of the following is true? - CORRECT ANSWER-A map allows duplicate keys to be stored; WRONG ANSWER Which of the following is true? - CORRECT ANSWER-Both the Set and List interfaces extend the Collection interface The concrete classes that implement the List interface are - CORRECT ANSWER-None of the above; WRONG ANSWER If you try to add an item to an ArrayList whose size is equal to its capacity, - CORRECT ANSWER-a new ArrayList object with twice the capacity is created, and the elements are moved to this new ArrayList. An object that is used to retrieve objects from a collection is called - CORRECT ANSWER-an accessor; WRONG ANSWER Which of the following is true? - CORRECT ANSWER-Any iterator can move forward as well as backwards through a collection; WRONG ANSWER Which of the following is true? - CORRECT ANSWER-The ListIterator interface is a subinterface of the Iterator interface The Vector class - CORRECT ANSWER-works just like ArrayList, except it is synchronized A LinkedList is the right kind of list to use when - CORRECT ANSWER-there are lots of insertions and deletions in the middle of the list A collection that is synchronized - CORRECT ANSWER-protects data from corruption when the data is accessed by multiple threads A collision occurs when - CORRECT ANSWER-objects whose values are not equal have the same hash code When using a HashSet - CORRECT ANSWER-you should override the hashCode and equals methods defined in the Object class Which of the following is true of a HashSet object? - CORRECT ANSWER-The time required to add an element, or search for an element, increases as the number of collisions increases LinkedHashSet differs from HashSet because - CORRECT ANSWER-the LinkedHashSet allows elements to be retrieved in the same order as they were added Comparable - CORRECT ANSWER-is a class that allows two objects to be compared; WRONG ANSWER Comparable - CORRECT ANSWER-specifies a single method, compareTo Comparator - CORRECT ANSWER-specifies two methods, compare and equals A TreeSet - CORRECT ANSWER-is like a Set that allows elements to be retrieved according to their natural order, or according to an order specified by a Comparator A HashMap - CORRECT ANSWER-is a subclass of Map that implements the HashCode interface;WRONG ANSWER

Mostrar más Leer menos
Institución
COSC 2336
Grado
COSC 2336










Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
COSC 2336
Grado
COSC 2336

Información del documento

Subido en
28 de mayo de 2024
Número de páginas
28
Escrito en
2023/2024
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

$13.57
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
BrooksOfBliss Teachme2-tutor
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
23
Miembro desde
1 año
Número de seguidores
12
Documentos
299
Última venta
6 meses hace
Brooks Of Bliss

Thanks in advance. We are pleased to be here just for you. We are offering the Best materials Already Graded A+ 100% Correct for Your Career Excellence in all your Exams. All the best in your study. Message me if you can not find the document you are looking for and i will assist you. Thanks again for purchasing my documents and Review to help others who need the best documents, kindly also refer others so that they can benefit from my documents ._Brooks of Blisss Here For Your Excellency.

Lee mas Leer menos
4.3

6 reseñas

5
4
4
0
3
2
2
0
1
0

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes