def testNodeHeightRightHeavy(self): """Test node height calculation - right heavy.""" n = avl.Node(3) n.right = avl.Node(4) n.left = avl.Node(1) n.right.right = avl.Node(5) self.assertEquals(3, n.compute_height())
def testNodeHeight(self): """Test node height calculation - balanced.""" self.assertEquals(4, self.t.root.compute_height()) n = avl.Node(3) n.left = avl.Node(2) n.right = avl.Node(4) n.left.left = avl.Node(1) n.right.right = avl.Node(5) self.assertEquals(3, n.compute_height())
import tkinter import interface import avl import fileParser # Permite o acesso direto node = avl.Node(15, []) print(node) main = tkinter.Tk() interface.MainMenu(main) # Opção para permitir a criação de uma menubar no Windows. main.option_add('*tearOff', False) main.mainloop()
def insertButton_function(self, tree): self.insertNodeIntoListView(tree, avl.Node(15, ["Lista", "de", "Dados"])) pass