forked from bayulaxana/data_structure_implementation
Module 2 (BST Traversal)
Dyandra Paramitha edited this page Apr 1, 2021
·
1 revision
-
void __inorder(BSTNode *root) { if (root) { __inorder(root->left); printf("%d ", root->key); __inorder(root->right); } }
-
void __postorder(BSTNode *root) { if (root) { __postorder(root->left); __postorder(root->right); printf("%d ", root->key); } }
-
void __preorder(BSTNode *root) { if (root) { printf("%d ", root->key); __preorder(root->left); __preorder(root->right); } }
For example on a Binary Search Tree :
The results printed out will be like this :
- Inorder : 1 2 3 4 5 6 7
- Postorder : 1 3 4 2 7 6 5
- Preorder : 5 2 1 4 3 6 7
Modul Struktur Data
Ditulis oleh tim Asisten Struktur Data 2020 - Teknik Informatika ITS
Modul 0
- Pengenalan Struktur Data IND | ENG
- Dynamic Array IND | ENG
- Linked List IND | ENG
- Soal Latihan IND | ENG
Modul 1
- Stack IND | ENG
- Queue IND | ENG
- Deque IND | ENG
- Priority Queue (List Based) IND | ENG
- Soal Latihan IND | ENG
Modul 2
- Pengenalan Tree IND | ENG
- Binary Search Tree IND | ENG
- Traversal BST IND | ENG
- Soal Latihan IND | ENG
Modul 3
Modul 4
- Melangkah Menuju C++ | ENG
- Standard Template Library Container | ENG
- Pengenalan Graf | ENG
- Traversal Graf | ENG
Modul 5