Java EE Basics (23)/recursion

Source: Internet
Author: User

1, File class recursive exercise (statistics of the folder size)
    • Requirement: 1, receive a folder path from the keyboard, statistics the folder size
2. File class Recursive exercise (delete this folder)
    • Requirement: 2, receive a folder path from the keyboard, delete the folder
3. File class recursive exercise (copy)
    • Requirements: 3, receive two folder path from the keyboard, copy one of the folders (contains content) to another folder
4. File class recursive exercise (print by level)
    • Needs: 4, from the keyboard to receive a folder path, the folder of all the files and the name of the folder to print at the level, for example: AAA is a folder, there are bbb.txt,ccc.txt,ddd.txt these files, such as the Eee folder, The Eee has fff.txt and ggg.txt, printing out tiers to AAA bbb.txt Ccc.txt Ddd.txt

      eee    fff.txt    ggg.txt
5. Recursive exercises (Fibonacci series)
    • No, Death bunny.
    • The story starts in 1202, saying that there is an Italian youth named Fibonacci.
    • In one of his writings he raises an interesting question: Suppose that a newborn bunny can grow into a big rabbit in one months, and a couple of rabbits in one months, and a couple of bunnies every month, and no death in a year,
    • Q: How many pairs of rabbits do they breed in a year, a pair of newborn rabbits?
    • 1 1 2 3 5 8 13
    • The first month a pair of bunnies 1
    • The second month a pair of big rabbits 1
    • The third month a pair of big rabbits gave birth to a small rabbit 2
    • The fourth month a pair of big rabbits gave birth to a pair of rabbits
    • A couple of bunnies grow into big rabbits. 3
    • Fifth month two to the big rabbit two pairs of rabbits
    • A couple of bunnies grow into big rabbits. 5
6, recursive exercise (1000 of the factorial of all 0 and the number of trailing zeros)
    • Requirements: Find the factorial of 1000 all 0 and the number of trailing zeros, do not have to do recursion
7, recursive exercise (1000 of the number of factorial tail zero)
    • Requirement: Find out the number of 1000 factorial trailing zeros, and use recursion to do
8. Set Exercises (Joseph Ring)
    • Lucky numbers

Java EE Basics (23)/recursion

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.