Question: DATA STRUCTURE LANGUAGE JAVA 1. Problem Description: In the children's game, Duck, Duck, Goose, a group of children sit in a circle. One of them

 DATA STRUCTURE LANGUAGE JAVA 1. Problem Description: In the children's game,

Duck, Duck, Goose, a group of children sit in a circle. One

DATA STRUCTURE

LANGUAGE JAVA

1. Problem Description: In the children's game, Duck, Duck, Goose, a group of children sit in a circle. One of them is elected "it" and that person walks around the outside of the circle. The person who is "it" pats each child on the head, saying "Duck each time, until randomly reaching a child that the "it" person identifies as "Goose." At this point there is a mad scramble, as the "Goose" and the "it" person race around the circle. Whoever returns to the Goose's former place first gets to remain in the circle. The loser of this race has to leave the game next round of play. The game continues like this until one child stays in the circle. Write software that simulates the game of Duck, Duck, Goose. 1.1 Requirements: You should have at least two classes: your data structure class and the game simulator class. You have to choose the best Linked-list to represent the players in the game (SLL, CLL, DLL). Your code should not have a time complexity higher than 0(n?). You are required to log the time of the simulation. Your code should work with special cases. 1.2 Game implementation details: The elected it in the game should be chosen randomly for every round. When "it" goes around the circle, he/she can pat the same player with DUCK up two times (see the sample output). Which means, if you have 4 players in the circle, then it can go around the circle up to 2 times. "it" should at least pat one player with DUCK before choosing a player to be GOOSE. Goose should be chosen randomly. You should randomly decide who win the race between it" and Goose. When a player is selected as it, he/she should start with the player sitting next to him/her. For example, if player 5 was selected as it, then it should start to pat player 6, then 7, etc. The player who wins the race ("it" or Goose), should sit back in the location of the goose. . 1.3 Sample output: The game has initialized with 18 players Player 4 was elected as "it" DUCK DUCK DUCK DUCK DUCK DUCK DUCK GOOSE player85 player86 playere7 player@8 player89 player10 playerei player 82 Player 2 was picked as goose RUN! player 2 won and back in the game, player 4 should leave the game Current players in the game: player2 player3 players player player7 players player player10 player1 Player 5 was elected as "it" DUCK GOOSE player&6 player Player 7 was picked as goose RUN! player 7 won and back in the game, player 5 should leave the gane Current players in the game: player7 players player9 player10 playerl player2 player3 player Player 8 was elected as "it" DUCK DUCK GOOSE player89 player1@ player01 Player 1 was picked as goose RUN! player 1 won and back in the game, player 8 should leave the game Current players in the game: playeri player2 players player player7 player9 playerle Player 6 was elected as "it" DUCK DUCK DUCK DUCK DUCK DUCK DUCK DUCK DUCK GOOSE player7 player09 playerle playerl player2 player83 playere7 player89 player10 player1 Player 1 was picked as goose RUN! "it" won, player 6 is back in the game, player 1 should leave the game Current players in the game: player player2 players player7 player player 10 1. Problem Description: In the children's game, Duck, Duck, Goose, a group of children sit in a circle. One of them is elected "it" and that person walks around the outside of the circle. The person who is "it" pats each child on the head, saying "Duck each time, until randomly reaching a child that the "it" person identifies as "Goose." At this point there is a mad scramble, as the "Goose" and the "it" person race around the circle. Whoever returns to the Goose's former place first gets to remain in the circle. The loser of this race has to leave the game next round of play. The game continues like this until one child stays in the circle. Write software that simulates the game of Duck, Duck, Goose. 1.1 Requirements: You should have at least two classes: your data structure class and the game simulator class. You have to choose the best Linked-list to represent the players in the game (SLL, CLL, DLL). Your code should not have a time complexity higher than 0(n?). You are required to log the time of the simulation. Your code should work with special cases. 1.2 Game implementation details: The elected it in the game should be chosen randomly for every round. When "it" goes around the circle, he/she can pat the same player with DUCK up two times (see the sample output). Which means, if you have 4 players in the circle, then it can go around the circle up to 2 times. "it" should at least pat one player with DUCK before choosing a player to be GOOSE. Goose should be chosen randomly. You should randomly decide who win the race between it" and Goose. When a player is selected as it, he/she should start with the player sitting next to him/her. For example, if player 5 was selected as it, then it should start to pat player 6, then 7, etc. The player who wins the race ("it" or Goose), should sit back in the location of the goose. . 1.3 Sample output: The game has initialized with 18 players Player 4 was elected as "it" DUCK DUCK DUCK DUCK DUCK DUCK DUCK GOOSE player85 player86 playere7 player@8 player89 player10 playerei player 82 Player 2 was picked as goose RUN! player 2 won and back in the game, player 4 should leave the game Current players in the game: player2 player3 players player player7 players player player10 player1 Player 5 was elected as "it" DUCK GOOSE player&6 player Player 7 was picked as goose RUN! player 7 won and back in the game, player 5 should leave the gane Current players in the game: player7 players player9 player10 playerl player2 player3 player Player 8 was elected as "it" DUCK DUCK GOOSE player89 player1@ player01 Player 1 was picked as goose RUN! player 1 won and back in the game, player 8 should leave the game Current players in the game: playeri player2 players player player7 player9 playerle Player 6 was elected as "it" DUCK DUCK DUCK DUCK DUCK DUCK DUCK DUCK DUCK GOOSE player7 player09 playerle playerl player2 player83 playere7 player89 player10 player1 Player 1 was picked as goose RUN! "it" won, player 6 is back in the game, player 1 should leave the game Current players in the game: player player2 players player7 player player 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!