Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 1 - Explanation In plain language, explain the base case ( s ) solutions ( and the condition when these should be performed )
Part Explanation
In plain language, explain the base cases solutions and the condition when these should be performed for the following recursive problems below:
Walk up all of the stairs until you reach the top of a building
Find the sum of all numbers in a list
Respond to everyone on your list of unread emails
Traverse every node in a linked list remember that we have methods to determine when the list ends!
Sort all of the playing cards in your hand order doesn't matter, ex: from Ace # King
In plain language, explain the recursive case solutions to the following problems below. You should try to be specific in terms of the information you will need when peforming the next recursive step. Recursive function calls don't implicitly have memory of whatever happened before they were called!
Walk up all of the stairs until you reach the top of a building
Find the sum of all numbers in a list
Traverse every node in a linked list remember that we have methods to determine when the list ends!
Part Implementation
For this section, be sure to indicate the base cases and recursive case as comments in your solution.
Write a recursive function, sumRangeR which will return the sum of all integers in an array of integers with length n in a range starting from index start, to index end.
This function does not simply add all of the values in the array! If start is and end is then the function should return arrarrarrarrarr and ignore the other values
Write a recursive function, helloAllR which will print a greeting to everyone in a given list of names, inputNames. inputNames is an array containing strings with length n
Ex: length inputNames Hwan "Tracie", "Yorbert" function prints: "Good morning, Hwan!" "Good morning, Tracie!" "Good morning, Yorbert!"
Write a recursive function, traverseLListR that will start from a pointer to some input node for example: "head" of a linked list and will print out data for each node until the end of the list
Ex: linked list has nodes with values: nullptr
If node with value has a pointer named startPtr, the function call should be traverseLListRstartPtr and should output:
Node class has a definition as shown below
class Node
public:
int number;
Node next nullptr;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started