Skip to main content
Not unmodifiable.
Source Link
nasukkin
  • 2.5k
  • 1
  • 14
  • 22

It appears that the sublist method runs in O(1) time. See the source code for the method.

All that this code does is return a non-modifiable viewnew instance of SubList that is initialized with the original List. Therelist that sublist is noinvoked upon. No iteration is happening here, so the operation runs in constant time.

It appears that the sublist method runs in O(1) time. See the source code for the method.

All that this code does is return a non-modifiable view of the original List. There is no iteration happening here.

It appears that the sublist method runs in O(1) time. See the source code for the method.

All that this code does is return a new instance of SubList that is initialized with the list that sublist is invoked upon. No iteration is happening here, so the operation runs in constant time.

Source Link
nasukkin
  • 2.5k
  • 1
  • 14
  • 22

It appears that the sublist method runs in O(1) time. See the source code for the method.

All that this code does is return a non-modifiable view of the original List. There is no iteration happening here.