University of Science, VNU – HCM
Faculty of Physics and Engineering
Department of Physics and Computer Science
Python
Programming
MSc. Vo Hoang Thuy Tien
Recursion
Week 6
3
Recursion
Exercise 1. Write a Pseudocode and draw a flow chart to compute Factorial
of n using recursion (the n value is selected by user).
Step 1: Start
Step 2: Input the n value
Step 3: Initialize result = factorial(n)
Step 4: Print the result value
Step 5: Stop
4
Recursion
Exercise 2. Write a Pseudocode and draw a flow chart to solve the Hanoi
Tower problem.
Step 1: Start
Step 2: Input the n (number of disk)
the from
the to
the seq
Step 3: call Hanoi_tower(n,from,to,seq)
Step 4: Stop
7
THANK YOU!
MSc. Vo Hoang Thuy Tien
Lecturer and Researcher
+84 937 64 99 14
vhttien@[Link]
University of Science, VNU – HCM
227 Nguyen Van Cu, Ward 4, District 5, Ho Chi Minh City