0% found this document useful (0 votes)
2 views5 pages

24dkd Ex Python Week6

The document contains exercises on recursion for a programming course, specifically focusing on computing the factorial of a number and solving the Hanoi Tower problem. It includes pseudocode and flowchart instructions for both exercises. The exercises are part of a curriculum taught by MSc. Vo Hoang Thuy Tien at the University of Science, VNU – HCM.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views5 pages

24dkd Ex Python Week6

The document contains exercises on recursion for a programming course, specifically focusing on computing the factorial of a number and solving the Hanoi Tower problem. It includes pseudocode and flowchart instructions for both exercises. The exercises are part of a curriculum taught by MSc. Vo Hoang Thuy Tien at the University of Science, VNU – HCM.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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

You might also like