Ejemplo n.º 1
0
    def testInsertAllSuccessor(self):
        veb = VEB(u=2**32)

        A = list(range(0, 100))
        veb.insertAll(A)

        for a in A[:-1]:
            self.assertEqual(
                veb.successor(a), a + 1,
                "Expected successor of {} to be {}".format(a, a + 1))
Ejemplo n.º 2
0
    def testInsertAllPredecessor(self):
        veb = VEB(u=2**32)

        A = list(range(0, 100))
        veb.insertAll(A)
        #        print(veb)

        for a in A[1:]:
            self.assertEqual(
                veb.predecessor(a), a - 1,
                "Expected predecessor of {} to be {}".format(a, a - 1))