Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

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

Beoordeling
-
Verkocht
-
Pagina's
28
Cijfer
A+
Geüpload op
28-05-2024
Geschreven in
2023/2024

COSC-2336_ Collections - Programming Fundamentals III Final Exam Correct Questions and Answers updated 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

Meer zien Lees minder
Instelling
COSC 2336
Vak
COSC 2336










Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Instelling
COSC 2336
Vak
COSC 2336

Documentinformatie

Geüpload op
28 mei 2024
Aantal pagina's
28
Geschreven in
2023/2024
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

$22.55
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
ShowvinePublishers Teachme2-tutor
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
75
Lid sinds
3 jaar
Aantal volgers
48
Documenten
1156
Laatst verkocht
2 maanden geleden
ShowvinePublishers

Running Out Of Time Don\'t Worry, we are dedicated and committed in delivering Well Researched and Prepared Assignments tailored towards achieving students goals and Passing Exams A+. All the Study Materials Graded A+ 100% Ready to bridge the gap for your success. \" ShowvinePublishers:- A One Store for all your exams purposes.\"

4.2

15 beoordelingen

5
8
4
3
3
3
2
1
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen