a) Implement a recursive algorithm that takes a decimal number n and converts n to its corresponding
Fantastic news! We've Found the answer you've been seeking!
Question:
- a) Implement a recursive algorithm that takes a decimal number n and converts n to its corresponding (you may return as a string) binary number.
- b) Implement a recursive algorithm to add all the elements of a non-dummy-headed singly linked linear list. Only the head of the list will be given as a parameter where you may assume every node can contain only an integer as its element.
Note: you’ll need a Singly Node class for this code. - c) Implement a recursive algorithm that will print all the elements of a non-dummy-headed singly linked linear list in reversed order.
For example: if the linked list contains 10, 20, 30, and 40, the method will print
40
30
20
10
Note: you’ll need a Singly Node class for this code.
Complete the code by using python
Please do not use any Built-In function. Do not copy-paste from other sources.
Related Book For
Discrete Mathematics and Its Applications
ISBN: 978-0073383095
7th edition
Authors: Kenneth H. Rosen
Posted Date: