Time for 10,000 get calls

  • 2
  • Locked
How much time and effort are you willing to spend to get something good? As long as it takes, we think. After all, you're currently trying to become a programmer. Let's see how long it takes to make 10,000 get calls on a LinkedList and an ArrayList. The getGetTimeInMs method must return its execution time in milliseconds.
You can't complete this task, because you're not signed in.
Comments (6)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Michael
Level 10 , Dresden, Germany
13 May 2021, 20:01
Like Peter, I also do not understand why the 'get10000' method does split the array in half. In this way only 5.000 items are retrieved. The body of the method 'get10000' should be:
while (!list.isEmpty()){list.get(0);}
carlos oliveira
Level 10 , Seattle, United States
19 November 2021, 00:35
...for each insertion in a list the fill() method returns the list size's...therefore the new object is inserted in decreasing list index order... "...println->(getGetTimeInMs->(fill(new Arraylist())))". Java - Encapsulation, Encapsulation is one of the four fundamental OOP concepts. The other three are inheritance, polymorphism, and abstraction. Encapsulation in Java is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit. In encapsulation, the variables of a class will be hidden from other classes, and can be accessed only through the methods of their current class.
Anonymous #10690611 Java Developer
10 February 2021, 18:42
in get10000, why do we use list.size()/2. Why do we need to split by half?
Lex Icon
Level 17 , Sofia, Bulgaria
6 December 2020, 19:00
hint: deja vu to the previous task.
andy 6473
Level 9 , Bangalore, India
21 July 2020, 15:02
Roman explain the code.
Ahmed
Level 23 , Amsterdam, Netherlands
10 May 2019, 15:24
ArrayList ftw!