There are basically two functions in this method. One is to print all nodes at a given level (printCurrentLevel), and the other is to print the level order traversal of the tree (printLevelorder).
printLevelorder makes use of printCurrentLevel to print nodes at all levels one by one starting from the root.
General Tree Level Order Traversal : https://www.geeksforgeeks.org/level-order-tree-traversal/