Created
April 30, 2020 09:21
-
-
Save AlexandreCantin/4594410ddc2518634f47f27ac7507092 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Structure de données encore inconnue | |
class Structure { | |
saveNode(node) {} | |
getNextNode() {} | |
} | |
// Fonction de traitement d'un noeud | |
var nodeStructure = new Structure() | |
function computeNode(node) { | |
if(!node) return; | |
computeNodeValue(node.value) | |
if(node.left) nodeStructure.saveNode(node.left) | |
if(node.right) nodeStructure.saveNode(node.right) | |
computeNode(nodeStructure.getNextNode()) | |
} | |
// Création de l'arbre et début du parcours | |
var tree = new Tree(...) | |
computeNode(tree.root) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment