A list is an _ object ___ whose data consists of ordered entries. Each entry is
ID: 3868802 • Letter: A
Question
A list is an _ object ___ whose data consists of ordered entries. Each entry is identified by its ___ position ___ within the list. The entries in a bag are _ unordered__, whereas the entries in a list, a stack, a queue, a deque, or a priority queue do have an ____ order __. A list, unlike a stack, a queue, a deque, or a priority queue, enables us to add, retrieve, remove, or replace an entry at _ any ____ given position. The ADT list can be implemented by using an_array_ or a _linked list __ to store items in a list. Adding an entry to or removing an entry from an array-based list typically requires that other entries __ shift ___ by one position within the array. This data movement degrades the time efficiency of these operations, particularly when the list is long and the position of the addition or removal is near the beginning of the list. Expanding the size of an array adds to the time required by the affected add method, since doing so requires ___ copying ____ the contents of the array to a larger array. Maintaining a reference to a chain's last node as well as to Its first node eliminates the need for a __ traversal _ when adding a node at the _ end __ of the chain. A client manipulates or accesses a list's entries by using only the operations defined for the ADT list. ListInterface runnerList = new AList (): ListInterface myList = new LList (): The client is of type ListInterface which has access to only the ADT list operations. Why does the time efficiency degrade when the list is long and the position of the addition or Removal is near the beginning of the list? Adding an entry near the beginning of the array requires making room for the new entry by shifting all other entries towards the end of the list. Removing an entry near the beginning of the array requires closing the gap left from removing that entry by shifting the entries one by one towards the beginning of the list. Why adding to the end of a list is faster when the chain has both head and tail references than when it has only a head reference? Eliminates the need for traversing (looping through) the whole chain to add a node at the end.Explanation / Answer
For complete the following, a small correction in 1.
1. A list is a collection of objects whose data consists of ordered entries. Each entry is identified by its position within the list.
Rest of the answers in fill in the blank are correct.
In Explain the following questions, 2 and 3 are correct. Answer for 1 is given below.
1. A client uses
ListInterface<String> runnerList = new AList<String>();
ListInterface<String> myList = new LList<String>();
Here both AList and LList are implementations of the interface called ListInterface. So an object declared of ListInterface, can be assigned any class implementing that interface. This eliminates the need to worry about the implementation details and the client can use different implementations of the ListInterface. In the above code, AList could be an Array based list where as LList could be a linked node list.
=============
Is there something apart from these to be answered? Let me know if more help is needed.
If happy with the answer, please do rate it . Thank you very much.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.