From 0da20427a485921aa591b896b8992418eaf138d6 Mon Sep 17 00:00:00 2001 From: Shinchan2803 <115401766+Shinchan2803@users.noreply.github.com> Date: Sun, 9 Oct 2022 16:47:56 +0530 Subject: [PATCH] Create Tower_of_hanoi.cpp this is most asked que in DSA and give the simple solution with the help of recursion --- Tower_of_hanoi.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Tower_of_hanoi.cpp diff --git a/Tower_of_hanoi.cpp b/Tower_of_hanoi.cpp new file mode 100644 index 0000000..1b88add --- /dev/null +++ b/Tower_of_hanoi.cpp @@ -0,0 +1,29 @@ +#include +using namespace std; + +string tower(int n,char s,char a,char d) +{ + if(n==1) + { + cout<<" "<>n; + //calling the TOH + tower(n,'A','B','C'); + + return 0; + + +return 0; +}