Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
    Bookmark Topic Watch Topic
  • New Topic

adding and incrementing data structure elements simultaneously with a faster time possible

Moulay Driss
Posts: 5
  • Mark post as helpful
  • send pies
  • Report post to moderator
I need to add the new element and increment the other objects of an array of objects (elemt) simultaneously with a faster time.


//------- The results:

Time without Incrementation : 15 ms

Time with Incrementation: 156 ms

My objective is to minimize as possible the time of incrementation process

(Time second test < Time first test * 2 )

because actually

Time second test (156 ms) = Time first test (15 ms )* 10

I notes that i can added a new element in any position, but i chose the worst case (adding an element in the first position that requires the incrementation of all **x** element of the arraylist)

I tried many data structure as vector, hashmap ,... but I could not minimize the time of incrementation
Jeff Verdegan
Posts: 6109
Android IntelliJ IDE Java
    Bookmark Topic Watch Topic
  • New Topic