Binary tree and BST tool
Draw a binary tree and get what ISC Computer Science asks about it: the preorder, inorder and postorder traversals, the height and levels, leaves, internal nodes, and each node's parent, children and sibling. Build it by inserting values into a binary search tree, give it level by level, or rebuild it from two traversals.
The tree
Traversals
- Preorder (root, left, right)
- A B D C E F
- Inorder (left, root, right)
- D B A E C F
- Postorder (left, right, root)
- D B E F C A
- Level order
- A B C D E F
About the tree
- Root
- A
- Number of nodes (size)
- 6
- Height = depth (edges from the root to the deepest leaf)
- 2
- Levels (the root is at level 0)
- 3
- Leaves (external nodes)
- D, E, F
- Internal nodes (not the root)
- B, C
- Full binary tree (every node has 0 or 2 children)
- No
- Complete binary tree
- No
- Binary search tree (inorder is in order)
- No
Every node
| Node | Level | Parent | Left child | Right child | Sibling | Degree | Kind |
|---|---|---|---|---|---|---|---|
| A | 0 | - | B | C | - | 2 | root |
| B | 1 | A | D | - | C | 1 | internal |
| C | 1 | A | E | F | B | 2 | internal |
| D | 2 | B | - | - | - | 0 | leaf |
| E | 2 | C | - | - | F | 0 | leaf |
| F | 2 | C | - | - | E | 0 | leaf |
Practise on real ISC questions
- Answer the following questions from the diagram of a Binary Tree given below: Name the root of the left sub… 2025 Specimen
- Answer the following questions from the diagram of a Binary Tree given below: Write the post-order traversal… 2026 Improvement
- State the difference between internal nodes and external nodes of a binary tree structure. 2019
- Write the pre-order traversal of the above tree. 2026
- Write the postorder traversal of the above tree structure. 2017
- State the difference between a Binary Tree structure and a single Linked List. 2020
- Answer the following questions from the diagram of a Binary Tree given below: Write the pre-order traversal… 2023
- Write the inorder traversal of the above tree structure. 2018
- Write the post order traversal of the tree. 2020 Specimen
- Write the post-order traversal of the left subtree of the above structure. 2020
More Computer Science tools
- Boolean algebra solver Simplify any expression: the laws step by step, truth table, K-map and the logic circuit.
- Infix to postfix converter Infix to postfix or prefix with the stack table, and postfix evaluation step by step.