Skip to content

Commit

Permalink
Cambios realizados desde ISIS1225-Lib
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipus85 committed Mar 26, 2021
1 parent 7bfbaa2 commit 1372474
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions DISClib/Algorithms/Trees/traversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,31 @@


def inorder(omap):
"""
Implementa un recorrido inorder de un arbol binario
"""
lst = lt.newList('SINGLE_LINKED', omap['cmpfunction'])
if (omap is not None):
lst = lt.newList('SINGLE_LINKED', omap['cmpfunction'])
lst = inorderTree(omap['root'], lst)
return lst


def preorder(omap):
"""
Implementa un recorrido preorder de un arbol binario
"""
lst = lt.newList('SINGLE_LINKED', omap['cmpfunction'])
if (omap is not None):
lst = lt.newList('SINGLE_LINKED', omap['cmpfunction'])
lst = preorderTree(omap['root'], lst)
return lst


def postorder(omap):
"""
Implementa un recorrido postorder de un arbol binario
"""
lst = lt.newList('SINGLE_LINKED', omap['cmpfunction'])
if (omap is not None):
lst = lt.newList('SINGLE_LINKED', omap['cmpfunction'])
lst = postorderTree(omap['root'], lst)
return lst

Expand Down

0 comments on commit 1372474

Please sign in to comment.