def test_BSTSelect(self): """ """ print('Test select') tree = bst.newMap('BST') self.assertTrue(bst.isEmpty(tree)) bst.put(tree, '50', 'Title 50', self.comparekeys) bst.put(tree, '70', 'Title 70', self.comparekeys) bst.put(tree, '30', 'Title 30', self.comparekeys) bst.put(tree, '80', 'Title 80', self.comparekeys) bst.put(tree, '60', 'Title 60', self.comparekeys) bst.put(tree, '40', 'Title 40', self.comparekeys) bst.put(tree, '20', 'Title 20', self.comparekeys) bst.put(tree, '10', 'Title 10', self.comparekeys) bst.put(tree, '25', 'Title 25', self.comparekeys) bst.put(tree, '6', 'Title 6', self.comparekeys) bst.put(tree, '12', 'Title 12', self.comparekeys) bst.put(tree, '7', 'Title 7', self.comparekeys) bst.put(tree, '28', 'Title 28', self.comparekeys) node = bst.select(tree, 1) #assert ?? print("select 1:", node['key'])
def selectBookMap(catalog, pos): """ Retorna la operación select (titulos) dentro del arbol """ return map.select(catalog['booksTree'], pos)
def selectBookTree (catalog, pos): """ Retorna la operación select (titulos) dentro del arbol """ return tree.select(catalog['booksTitleTree'], pos)
def selectAccidentMap (catalog, pos): """ Retorna la operación select (fecha) dentro del arbol """ return map.select(catalog['accidentsTree'], pos)