Revision: 68440
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at January 18, 2015 14:35 by 8ivana8
Initial Code
void PreOrder(tree* T){ int node = T->root; cout << node << " "; if(T->array[node].firstchild != -1){ T->root = T->array[node].firstchild; PreOrder(T); } if(T->array[node].nextsibling != -1){ T->root = T->array[node].nextsibling; PreOrder(T); } } void InOrder(tree* T){ int node = T->root; if(T->array[node].firstchild != -1){ T->root = T->array[node].firstchild; InOrder(T); } int parent = ParentT(node, T); if(T->array[node].firstchild == -1) cout << node << " "; if(FirstChildT(parent, T) == node) cout << parent << " "; if(T->array[node].nextsibling != -1){ T->root = T->array[node].nextsibling; InOrder(T); } } void PostOrder(tree* T){ int node = T->root; if(T->array[node].firstchild != -1){ T->root = T->array[node].firstchild; PostOrder(T); } cout << node << " "; if(T->array[node].nextsibling != -1){ T->root = T->array[node].nextsibling; PostOrder(T); } }
Initial URL
Initial Description
Implementacija algoritma ophođenja stabla (preorder, inorder, postorder) za kolegij Strukture podataka.
Initial Title
algoritam ophođenja stabla_preorder_inorder_postorder
Initial Tags
Initial Language
C++