When we are inserting a new node in the binary search tree, we have to consider the following steps:
- Create a new node as a leaf (no left child or right child).
- Start with the root node and set it as the current node.
- If the node is empty, make the new node as the root.
- Check whether the new value is less than the current node or more.
- If less, go to the left and set the left as the current node.
- If more, go to the right and set the right as the current node.
- Continue to step 3 until all the nodes are visited and the new node is set.