In Java please
Consider the following problem: There are threepegs, denoted A, B, and C, and N disks of different sizes.Originally, all the disks are on peg A, stacked in decreasing sizefrom bottom to top. Your goal is to transfer all the disks topeg B, and the rules are that you can only moveone disk at a time, no disk can be moved onto a smaller one, andyou make use of all pegs.
Develop a solution to this problem based on the principle ofrecursion, i.e., this problem has to be solved by programming arecursive procedure. The use of global variables is not permitted.Your solution must print a protocol about the movements of thedisks. Use only pseudocode to write down your solution.