Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

please I need answers asap (with explanations if possible) 1. Which of the follo

ID: 3781847 • Letter: P

Question

please I need answers asap (with explanations if possible)

1. Which of the following most analogous to an ADT (Abstract Data Type)? Data Structure Abstract Programming Interface (API) Array (your response) Java Generics Clicker Points earned: 0 out of 1 2. Consider an Arraylist. Internally it is not full, and the number of elements inserted so far is known. The elements are not sorted Choose the operations listed below that are fast regardless of the number of elements contained in the ArrayList. (In other words, takes only several instructions to implement) Finding the maximum value in an array of integers (not necessarily sorted) Getting the data from a specified index (your response) Replacing an element at a specified index Insertion (your response) Insertion at a given index (your response) Deletion at the given index (your response) Searching for a specific element Points earned: 0 out of 1

Explanation / Answer

1) JAVA GENERICS are most analogous to an ADT.   

EXPLANATION: An abstract data type is defined as a mathematical model of the data objects that make up a data type as well as the functions that operate on these objects. There are no standard conventions for defining them. Similarly,JAVA GENERICS also don't have standard conventions. They also react according to the data sent into the functions.

2)Operations:

If time is considered as a factor then 4,5 are not suitable as it will take more time to insert and delete a value from specified index

3)E is generic,so you will have to treat it like an object, and downcast accordingly

5)Compilation is correct for :

Reason : an object can be declared by data type of the same class or higher implemented class