- changed milestone to Next Minor Release
-
assigned issue to
TLongLinkedList binarySearch problem?
Issue #47
new
Try...
TLongList nums = new TLongLinkedList(); nums.add(1L); nums.add(2L); nums.add(3L); nums.add(4L); nums.add(6L); nums.add(7L); nums.add(8L); nums.add(9L); nums.add(10L); nums.sort(); System.out.println(nums.binarySearch(4L));
Gives -4 not 3 as one might expect.
Replace TLongLinkedList with TLongArrayList and you indeed get 3. Can understand that the first one is a linked list of course and the behaviour is kind of to be expected as 5L is missing from nums. Still, this is confusing.
Comments (7)
-
-
- changed milestone to 3.0.5.b1
-
- changed milestone to 3.0.5.m1
-
- changed milestone to 3.1
-
- removed responsible
-
- changed milestone to Future
This is a bug in a class in the experimental package. Whilst I do agree that it needs to be fixed, and is quite broken, I am prioritising bugs in the core package.
-
- marked as minor
- Log in to comment