In: Computer Science
As a programmer in a java project, you have been asked
by your project manager to describe the most efficient way to store
the following assigned numbers 10,20,30,1000,200,350 for an
operation which involves on calculation such as sum and
average.
The most efficient way to store the following assigned numbers 10,20,30,1000,200,350 for an operation which involves on calculation such as sum and average is an array.
The efficient way to store numbers is an array. It provides indexing and fast access of array elements. As we are required to perform calculations such as sum and average, the elements should be accessed faster. The fast accessing of element can be done by using array. So, I would prefer array to store the above numbers.