Question 1: Convert a decimal to binary and binary to decimal using recursion Test your implementation with following examples: ● (1947)10 = (11110011011)2 ● (1992)10 = (11111001000)2 ● (2021)10 = (11111100101)2

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

Question 1:
Convert a decimal to binary and binary to decimal using recursion
Test your implementation with following examples:
● (1947)10 = (11110011011)2
● (1992)10 = (11111001000)2
● (2021)10 = (11111100101)2
Question 2:
Implement a member function that prints a singly linked list in reverse order without creating a
copy or changing the original List.
void printBackwards() const
Question 3:
Implement a recursive member function “isSorted” which recursively checks whether the linked list
is sorted (ascendingly).
bool isSorted() const
Question 4:
You will implement a function bool Equalize_Occurrences (char key, int maxcount) of the
class list, that will take a character key and maximum count for the consecutive occurrences of the
key in
parameters. It will then traverse the list, verify and update the consecutive occurrences of the key
according
to maximum count and returns true. It returns false if no occurrence of key is found.
Note: You can traverse the list only once for this task.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Matrix multiplication
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning