Java Data Structure Runtime Complexity