def test_589(self): sl = Skiplist() sl.distribution = uniform(2) sl[10] = 10 sl[2] = 2 sl[3] = 3 self.assertTrue(True)
def test_sorted(self): sl = Skiplist() sl.distribution = uniform(2) import random l = [random.randint(1, 78) for i in range(10)] for i in l: sl[i] = i for level in range(len(sl.head.nxt)): self.assertEqual(sorted(set(l)), [node.key for node in sl._level(sl.head.nxt[-1], level)])
def test_sorted(self): sl = Skiplist() sl.distribution = uniform(2) import random l = [random.randint(1, 78) for i in range(10)] for i in l: sl[i] = i for level in range(len(sl.head.nxt)): self.assertEqual( sorted(set(l)), [node.key for node in sl._level(sl.head.nxt[-1], level)])