update,
This commit is contained in:
19
max015/CDS2003_assignment02/_ref/digest.md
Normal file
19
max015/CDS2003_assignment02/_ref/digest.md
Normal file
@@ -0,0 +1,19 @@
|
||||
## Mandatory
|
||||
|
||||
- P01: Please use recursion to define and test a function to calculate the sum of a list of numbers.
|
||||
`def list_sum_Recur(num_list):`
|
||||
- P02: Please use recursion to define and test a function to find the greatest common division of two positive integers.
|
||||
`def gcd_Recur(a,b):`
|
||||
- P03: Please use recursion to define and test a function to calculate the harmonic series upto `n` terms.
|
||||
`def harmonic_sum_Recur(n):`
|
||||
- P04: Please use recursion to define and test a function to calculate the value of 𝑥 to the power of `n`.
|
||||
`def power_Recur(x,n):`
|
||||
|
||||
## Optional
|
||||
|
||||
- P05: Please use recursion to define and test a function to accept a decimal integer and display its binary equivalent.
|
||||
`def Dec2Binary_Recur(num):`
|
||||
- P06: Please use recursion to define and test a function to take in a string and returns a reversed copy of the string.
|
||||
`def reverse_Recur(a,b):`
|
||||
- P07: Please use recursion to define and test a function to check whether a number is Prime or not.
|
||||
`def isPrime_Recur(a,b):`
|
Reference in New Issue
Block a user