コード例 #1
0
 def test_eliminate_number_corrected(self):
     Tarea4.c = 84685486
     Tarea4.a = 191214
     hash_table = [-1] * hash_len
     for i in range(890):
         hash_table[randint(0, hash_len - 1)] = 1
     hash_table[990] = 145381
     self.assertEqual(1, Tarea4.buscar(hash_table, hash_len, 145381))
コード例 #2
0
 def test_find_number_corrected(self):
     Tarea4.c = 846854
     Tarea4.a = 194884184
     hash_table = [-1] * hash_len
     for i in range(890):
         hash_table[randint(0, hash_len - 1)] = 1
     hash_table[14] = 145381
     self.assertEqual(1, Tarea4.buscar(hash_table, 39, 145381))
コード例 #3
0
 def test_find_number_not_in_hash(self):
     Tarea4.c = 654321
     Tarea4.a = 123456
     hash_table = [-1] * hash_len
     self.assertEqual(0, Tarea4.buscar(hash_table, hash_len, 61235))
コード例 #4
0
 def test_find_number_in_hash(self):
     Tarea4.c = 2
     Tarea4.a = 6000002
     hash_table = [-1] * hash_len
     hash_table[866] = 78432
     self.assertEqual(1, Tarea4.buscar(hash_table, hash_len, 78432))