Skip to content

Instantly share code, notes, and snippets.

@mycodeschool
mycodeschool / PreorderInorderPostorder_CPP.cpp
Last active October 29, 2023 09:20
Binary tree traversal: Preorder, Inorder, Postorder
/* Binary Tree Traversal - Preorder, Inorder, Postorder */
#include<iostream>
using namespace std;
struct Node {
char data;
struct Node *left;
struct Node *right;
};
/* Binary tree - Level Order Traversal */
#include<iostream>
#include<queue>
using namespace std;
struct Node {
char data;
Node *left;
Node *right;
};