Package gnu.trove.list

Examples of gnu.trove.list.TIntList.binarySearch()


    list.add( 5 );

    // Uncomment this to see infinite loop from bug 3379877
//    list.binarySearch( 6 );

    assertEquals( -1, list.binarySearch( Integer.MIN_VALUE ) );
    assertEquals( -1, list.binarySearch( -1 ) );
    assertEquals( -1, list.binarySearch( 0 ) );
    assertEquals( -1, list.binarySearch( 1 ) );
    assertEquals( -1, list.binarySearch( 2 ) );
    assertEquals( -1, list.binarySearch( 3 ) );
View Full Code Here


    // Uncomment this to see infinite loop from bug 3379877
//    list.binarySearch( 6 );

    assertEquals( -1, list.binarySearch( Integer.MIN_VALUE ) );
    assertEquals( -1, list.binarySearch( -1 ) );
    assertEquals( -1, list.binarySearch( 0 ) );
    assertEquals( -1, list.binarySearch( 1 ) );
    assertEquals( -1, list.binarySearch( 2 ) );
    assertEquals( -1, list.binarySearch( 3 ) );
    assertEquals( -1, list.binarySearch( 4 ) );
View Full Code Here

    // Uncomment this to see infinite loop from bug 3379877
//    list.binarySearch( 6 );

    assertEquals( -1, list.binarySearch( Integer.MIN_VALUE ) );
    assertEquals( -1, list.binarySearch( -1 ) );
    assertEquals( -1, list.binarySearch( 0 ) );
    assertEquals( -1, list.binarySearch( 1 ) );
    assertEquals( -1, list.binarySearch( 2 ) );
    assertEquals( -1, list.binarySearch( 3 ) );
    assertEquals( -1, list.binarySearch( 4 ) );
View Full Code Here

//    list.binarySearch( 6 );

    assertEquals( -1, list.binarySearch( Integer.MIN_VALUE ) );
    assertEquals( -1, list.binarySearch( -1 ) );
    assertEquals( -1, list.binarySearch( 0 ) );
    assertEquals( -1, list.binarySearch( 1 ) );
    assertEquals( -1, list.binarySearch( 2 ) );
    assertEquals( -1, list.binarySearch( 3 ) );
    assertEquals( -1, list.binarySearch( 4 ) );

    assertEquals( 0, list.binarySearch( 5 ) );
View Full Code Here

    assertEquals( -1, list.binarySearch( Integer.MIN_VALUE ) );
    assertEquals( -1, list.binarySearch( -1 ) );
    assertEquals( -1, list.binarySearch( 0 ) );
    assertEquals( -1, list.binarySearch( 1 ) );
    assertEquals( -1, list.binarySearch( 2 ) );
    assertEquals( -1, list.binarySearch( 3 ) );
    assertEquals( -1, list.binarySearch( 4 ) );

    assertEquals( 0, list.binarySearch( 5 ) );
View Full Code Here

    assertEquals( -1, list.binarySearch( Integer.MIN_VALUE ) );
    assertEquals( -1, list.binarySearch( -1 ) );
    assertEquals( -1, list.binarySearch( 0 ) );
    assertEquals( -1, list.binarySearch( 1 ) );
    assertEquals( -1, list.binarySearch( 2 ) );
    assertEquals( -1, list.binarySearch( 3 ) );
    assertEquals( -1, list.binarySearch( 4 ) );

    assertEquals( 0, list.binarySearch( 5 ) );

    assertEquals( -2, list.binarySearch( 6 ) );
View Full Code Here

    assertEquals( -1, list.binarySearch( -1 ) );
    assertEquals( -1, list.binarySearch( 0 ) );
    assertEquals( -1, list.binarySearch( 1 ) );
    assertEquals( -1, list.binarySearch( 2 ) );
    assertEquals( -1, list.binarySearch( 3 ) );
    assertEquals( -1, list.binarySearch( 4 ) );

    assertEquals( 0, list.binarySearch( 5 ) );

    assertEquals( -2, list.binarySearch( 6 ) );
  }
View Full Code Here

    assertEquals( -1, list.binarySearch( 1 ) );
    assertEquals( -1, list.binarySearch( 2 ) );
    assertEquals( -1, list.binarySearch( 3 ) );
    assertEquals( -1, list.binarySearch( 4 ) );

    assertEquals( 0, list.binarySearch( 5 ) );

    assertEquals( -2, list.binarySearch( 6 ) );
  }

View Full Code Here

    assertEquals( -1, list.binarySearch( 3 ) );
    assertEquals( -1, list.binarySearch( 4 ) );

    assertEquals( 0, list.binarySearch( 5 ) );

    assertEquals( -2, list.binarySearch( 6 ) );
  }


  public void testSum() {
    TIntList list = new TIntLinkedList();
View Full Code Here

            a.add( i );
        }

        a.sort();

        int index = a.binarySearch( 5 );
        assertEquals( 4, index );

        index = a.binarySearch( 8 );
        assertEquals( 7, index );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.