To print the top view of a binary tree, we can apply level order traversal and vertical order traversal.Level order traversal gives the nodes in the order of their occurrence in each level.Vertical order traversal helps to calculate the horizontal distance of each node.To get the top view, we select the first node at each horizontal distance.