Question: B. 1 20 Points write in pseudo code a tail-recursive algorithm .reverse, using the Sequence ADT that creates from a given sequence a new copy

B. 1 20 Points write in pseudo code a tail-recursive algorithm .reverse, using the Sequence ADT that creates from a given sequence a new copy in reverse order. For instance, if SI represents the sequence (1,2,3), then S2: reverse(S1) returns a sequence that represents (3,2,1) but leaves SI unchanged 1. 8 Points] Describe in pseudo-code a tail-recursive version of reverse. 2. 8 Points] Describe in pseudo-code an iterative version of reverse. 3. I4 Points] What are the worst-case runtimes of your above algorithms (use the bie-Oh notation) Justify your answers
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
