Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with java program, please explain it. I'm having a hard time doing it You're on a slightly dysfunctional software team, with two teammates

Need help with java program, please explain it. I'm having a hard time doing it

image text in transcribed

You're on a slightly dysfunctional software team, with two teammates who constantly argue about the best way of doing things. This arguing has led to a miscommunication about which way a big pile of input data should be read, the result of which is that now you have a huge, singly-linked list of Strings in reverse order. It's your job to write a function that can reverse the order of a singly-linked list, but your teammates are still arguing about which approach your function should take. Alex believes you should take a straightforward, iterative approach, while Briar believes your solution should be recursive. To make peace with your teammates, you must present two functions for reversing a singly-linked list, one recursive and one iterative, and determine which one is better. You're primarily concerned about the run-time efficiency of your solution, although memory- space efficiency could be used as a tie-breaker. Be sure to include error and exception handling to keep your teammates from seizing on that. You must also submit your best-effort for both approaches, as your teammates will be able to tell if you deliberately sabotage one function to make picking the competitor easier. You must submit one Java file, though it may include multiple classes, particularly to support building the singly-linked list of String-bearing nodes. The test file may make a list of any length with any dummy String data inside the nodes you want, though a longer list or multiple lists may help demonstrate your point about how each function performs. Both functions must be proven to actually reverse the list, and the nodes in the final reversed list should be the same ones as in the original list (not just copies of the same content, but the same instanced objects). Your written answer to this question should explain which teammate's approach is the better choice for this problem, based on the two functions you wrote. Include an asymptotic run-time analysis for both, and use this as part of your argument. Aside from time and possibly space efficiency, you're allowed to justify your argument however you like - be persuasive! You're on a slightly dysfunctional software team, with two teammates who constantly argue about the best way of doing things. This arguing has led to a miscommunication about which way a big pile of input data should be read, the result of which is that now you have a huge, singly-linked list of Strings in reverse order. It's your job to write a function that can reverse the order of a singly-linked list, but your teammates are still arguing about which approach your function should take. Alex believes you should take a straightforward, iterative approach, while Briar believes your solution should be recursive. To make peace with your teammates, you must present two functions for reversing a singly-linked list, one recursive and one iterative, and determine which one is better. You're primarily concerned about the run-time efficiency of your solution, although memory- space efficiency could be used as a tie-breaker. Be sure to include error and exception handling to keep your teammates from seizing on that. You must also submit your best-effort for both approaches, as your teammates will be able to tell if you deliberately sabotage one function to make picking the competitor easier. You must submit one Java file, though it may include multiple classes, particularly to support building the singly-linked list of String-bearing nodes. The test file may make a list of any length with any dummy String data inside the nodes you want, though a longer list or multiple lists may help demonstrate your point about how each function performs. Both functions must be proven to actually reverse the list, and the nodes in the final reversed list should be the same ones as in the original list (not just copies of the same content, but the same instanced objects). Your written answer to this question should explain which teammate's approach is the better choice for this problem, based on the two functions you wrote. Include an asymptotic run-time analysis for both, and use this as part of your argument. Aside from time and possibly space efficiency, you're allowed to justify your argument however you like - be persuasive

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting For Decision Making And Control

Authors: Jerold L. Zimmerman

8th International Edition

007131475X, 9780071314756

Students also viewed these Databases questions