Ask Question
24 August, 19:34

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:

+1
Answers (1)
  1. 24 August, 19:59
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers