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.
- 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.
Step by Step Solution
3.37 Rating (153 Votes )
There are 3 Steps involved in it
ANSWER2 2 a public class Program1 param num integer return the binary representation of the integer ... View full answer
Get step-by-step solutions from verified subject matter experts
