Ask Question
6 May, 15:40

Suppose list1 is an MyArrayList and list2 is a MyLinkedList. Both contains 1 million double values. Analyze the following code: A: while (list1. size () > 0) list1. remove (size () - 1); B: while (list2. size () > 0) list2. remove (size () - 1); Question 42 options:

+2
Answers (1)
  1. 6 May, 16:45
    0
    The correct answer for the given question is " The Code fragment A runs fastly than the code fragment of B".

    Explanation:

    In this question there are some information is missing i. e options. The question does not give any options. The options for the given question is given below

    (A.) The Code fragment A runs fastly than the code fragment of B.

    (B.) The Code fragment B runs fastly than code fragment of A.

    (C) The Code fragment A runs as fastly as code fragment of B.

    So we conclude the answer i. e option (A) because As given in the question list1 is a MyArrayList and list2 is a MyLinkedList., in list1 we fetching the data easily and fastly means that it remove the data easily as compare to list2 As MyArrayList is storing the list only and also we can fetch the data easily manner.

    The list2 is an object of MyLinkedList means that it manipulating the data fastly as compared to MyArrayList but if we compared the fetching of data then MyArrayList is a better option so the code fragment runs fastly then code fragmented B.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Suppose list1 is an MyArrayList and list2 is a MyLinkedList. Both contains 1 million double values. Analyze the following code: A: while ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers