Programming Java: Solution to three water jug problem infinite loop error -- 2
$10-30 USD
Completed
Posted almost 2 years ago
$10-30 USD
Paid on delivery
I am trying to write code that solves similar to this: [login to view URL]) , except the problem uses three water jugs. You start with one of the jugs being full and the others being empty, then choose two out of the three jugs and pour the contents of one of these into the other one until either one is empty or the second is full, and this can be repeated multiple times until the the desired amount of water in a jug is achieved. cap[] is an integer array of the capacities of the containers and d is the desired number to be obtained, both entered by input. If no solution can be obtained then no output should be produced. The following input: 20 5 3 4 should produce the following output:
20 0 0
15 5 0
15 2 3
18 2 0
18 0 2
13 5 2
13 4 3
Where 20 5 3 are capacities of the three containers and 4 is the desired number to be reached ie the variable d.
The code requires using no more advanced data structures than arraylists, linkedlists, stacks, and queues. I have already have code for this program however it appears to get stuck in an infinite loop when given the following input to test it out: 81 52 43 21
My request is to have the code fixed so it can work with the prior input to not do infinite loop. The code is linked.
✅ Full Experiences and Profound Knowledge in ⭐Java Programming⭐✅.
Hi, how are you?
I am very confident to complete your project perfectly.
I can start your work right now.
Of course, since I am new here, then my job history and feedback score on freelancer is not sufficient, but you don’t need to worry!
I can guarantee the quality of the job and deliver the result on time.
I hope we will discuss in more detail via chat.
Best regards!
https://www.freelancer.com/u/KawlCarter
Hi
I'm skilled software engineer, and I'm hard worker,
I've seen your job description about (( Solution to three water jug problem infinite loop error )) and i'm ready to help you skillfully.
Hope to hear from you soon.
Best regards,
Said.
GOOD IN JAVASCRIPT, MYSQL, PYTHON, C PROGRAMMING AND HTML
HELLO DEAR CLIENT
Thank you for sharing your project requirement, I have carefully read the project description and I would like to take part in this project.
I will work according to your requirement to provide the best quality and customer satisfaction. I hope you will benefit from my services I can assurance that I will live up to your expectation