top of page

Week 5: Recursion

  • Writer: leprik9
    leprik9
  • Nov 18, 2015
  • 1 min read

This week i learnt how to use recursive functions. I will mix questions one and two together. The first one was to create a Koch curve and the second one was to create a Koch snowflake. Here it the solution to both of these.

Then again we start with the more advanced questions. The next one was to create a recursive funtion that checks if a given string is palindrome.

The 5th task was to write a recursive function that perform floor division without using the \\ operator. Here is the solution:

And the last task was to create again a recursive function that perform power calculation without using the ** symbol. Solution below:

 
 
 

Comments


Featured Posts
Recent Posts
Archive
Search By Tags
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square

Email:
kabadzhg@uni.coventry.ac.uk

bottom of page