subject

Suppose list1 is an arraylist and list2 is a linkedlist. both contains 1 million double values. analyze the following code:
a: for (int i = 0; i < list1.size(); i++)
sum += list1.get(i);
b: for (int i = 0; i < list2.size(); i++)
sum += list2.get(i);
a. code fragment a runs faster than code fragment b.
b. code fragment b runs faster than code fragment a.
c. code fragment a runs as fast as code fragment b.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 06:20
Which text function capitalizes the first letter in a string of text? question 10 options: upper capital first proper
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
Design a class tictactoe that: holds the following information about the game: two-dimensional array (3 by 3), and winner. add additional variables as needed. includes the functions to perform the various operations on objects. for example, function to print the board, getting the move, checking if move is valid, determining if there is a winner after each move. add additional operations as needed. includes constructor(s). write the functions of the class, and write a program that uses the class. the program should declare an object of type tictactoe. the program will create the board and store it in the array. the program will allow two players to play the tic-tac-toe game. after every valid move update the array, check if there is a winner. if there is no winner and no tie, then print the board again to continue.
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
Which one of the following functions is not available on the autosum tool? sum average if max
Answers: 3
question
Computers and Technology, 24.06.2019 17:40
The value of sin(x) (in radians) can be approximated by the alternating infinite series create a function (prob3_2) that takes inputs of a scalar angle measure (in radians) and the number of approximation terms, n, and estimates sin(x). do not use the sin function in your solution. you may use the factorial function. though this can be done without a loop (more efficiently), your program must use (at least) one. you may find the mod() function useful in solving the problem.
Answers: 1
You know the right answer?
Suppose list1 is an arraylist and list2 is a linkedlist. both contains 1 million double values. anal...
Questions
question
Geography, 22.10.2020 20:01
question
History, 22.10.2020 20:01
question
Mathematics, 22.10.2020 20:01
question
Mathematics, 22.10.2020 20:01
question
Biology, 22.10.2020 20:01
Questions on the website: 13722363