Ask Question
5 December, 16:41

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:

+4
Answers (1)
  1. 5 December, 18:51
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers