Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

you can use single linked list circularly linked list or array In the children's game, Duck, Duck. Goose, a group of children sit in a

image text in transcribed
image text in transcribed
image text in transcribed
you can use single linked list circularly linked list or array image text in transcribed
image text in transcribed
image text in transcribed
In the children's game, Duck, Duck. Goose, a group of children sit in a circle. One of them is elected 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 person identifies as "Goose. At this point there is a mad scramble, as the "Goose and the 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. 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 Your code should not have a time complexity higher than O(n) You are required to log the time of the simulation Implementation details: The elected in the game should be chosen randomly for every round. When poes around the circle, hol'she can put the same player with DUCK up two times (see the sample output). Which means, if you have 4 players in the circle, DLL) can go around the circle up to 2 times *** should at least pet 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 and Goose When a player is selected as the she should start with the player itting next to him her. For example, if players was selected the should start to put player 6, then 7. cte The player who wins the race (ir or Goose) should sit back in the location of the goose THE OUTPUT: The gate resiniz var BUOK ORK GICE DUCE BOX DOC OIESE per le reste 2 In the goes toets vio test the same layer player Slovers are start Current players in the gates CAR per les entre les OSE re Care love RS Series Hes SO INTER RE WEB Current Out 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 O(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 gane has initialized with 18 players Player 4 was elected as "it" DUCK DUCK DUCK DUCK DUCK DUCK DUCK GOOSE playeras player86 player7 playered player player1e playere1 playere2 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 player players players player7 players players playerle player Player 5 was elected as "it" DUCK GOOSE player06 playere? Player 7 was picked as goose RUN! player 7 won and back in the game, player 5 should leave the game Current players in the game: player player player player10 player1 player2 player3 player Player 8 was elected as "it" DUCK DUCK GOOSE player89 player10 players Player 1 was picked as goose RUN! player 1 won and back in the game, player 8 should leave the gane Current players in the game: playeri player2 players players player7 players playerse DUCK Player 6 was elected as "it" DUCK DUCK DUCK DUCK DUCK DUCK DUCK DUCK GOOSE player7 player89 player10 playere1 playero2 player83 player07 player playerle player1 Player 1 was picked as goose RUN! "it" won, player 6 is back in the gane, player 1 should leave the game player player2 player3 player? players playerie DUCK Player 9 was elected as DUCK DUCK DUCK DUCK GOOSE playerle player player2 playero3 player player 1 Player 10 was picked as goose RUN! player 10 won and back in the gane, players should leave the game Current players in the game! playerle players player2 player player Player 2 was elected as "1" DUCK DUCK DUCK DUCK DUCK DUCK GOOSE player3 playeroz playerio player playero3 player player 10 Player 18 was picked as goose RUN! player 18 won and back in the game, player 2 should leave the game Current players in the game: player le players player player Player 3 was elected as "it" DUCK DUCK DUCK DUCK DUCK DUCK DUCK DUCK GOOSE player7 playerse player playeraz player10 player player players players Player 6 was picked as goose RUN! player 6 won and back in the game, player should leave the game Current players in the game! player player player 10 Player 6 was elected as it DUCK DUCK GOOSE playere7 playeria player Player 7 was picked as goose RUN player 7 won and back in the game, player 6 should teave the gane Current players in the gamet player7 player10 Player 7 was elected as "it" DUCK DUCK DUCK DUCK DUCK DUCK GOOSE playerse player playerio player1e player le player10 playerie Player 10 was picked as goose RUN! "it" on, player 7 is back in the game, player 30 should leave the game Current players in the game! player Player 7 won the game! The simulator spent 305 ms In the children's game, Duck, Duck. Goose, a group of children sit in a circle. One of them is elected 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 person identifies as "Goose. At this point there is a mad scramble, as the "Goose and the 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. 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 Your code should not have a time complexity higher than O(n) You are required to log the time of the simulation Implementation details: The elected in the game should be chosen randomly for every round. When poes around the circle, hol'she can put the same player with DUCK up two times (see the sample output). Which means, if you have 4 players in the circle, DLL) can go around the circle up to 2 times *** should at least pet 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 and Goose When a player is selected as the she should start with the player itting next to him her. For example, if players was selected the should start to put player 6, then 7. cte The player who wins the race (ir or Goose) should sit back in the location of the goose THE OUTPUT: The gate resiniz var BUOK ORK GICE DUCE BOX DOC OIESE per le reste 2 In the goes toets vio test the same layer player Slovers are start Current players in the gates CAR per les entre les OSE re Care love RS Series Hes SO INTER RE WEB Current Out 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 O(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 gane has initialized with 18 players Player 4 was elected as "it" DUCK DUCK DUCK DUCK DUCK DUCK DUCK GOOSE playeras player86 player7 playered player player1e playere1 playere2 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 player players players player7 players players playerle player Player 5 was elected as "it" DUCK GOOSE player06 playere? Player 7 was picked as goose RUN! player 7 won and back in the game, player 5 should leave the game Current players in the game: player player player player10 player1 player2 player3 player Player 8 was elected as "it" DUCK DUCK GOOSE player89 player10 players Player 1 was picked as goose RUN! player 1 won and back in the game, player 8 should leave the gane Current players in the game: playeri player2 players players player7 players playerse DUCK Player 6 was elected as "it" DUCK DUCK DUCK DUCK DUCK DUCK DUCK DUCK GOOSE player7 player89 player10 playere1 playero2 player83 player07 player playerle player1 Player 1 was picked as goose RUN! "it" won, player 6 is back in the gane, player 1 should leave the game player player2 player3 player? players playerie DUCK Player 9 was elected as DUCK DUCK DUCK DUCK GOOSE playerle player player2 playero3 player player 1 Player 10 was picked as goose RUN! player 10 won and back in the gane, players should leave the game Current players in the game! playerle players player2 player player Player 2 was elected as "1" DUCK DUCK DUCK DUCK DUCK DUCK GOOSE player3 playeroz playerio player playero3 player player 10 Player 18 was picked as goose RUN! player 18 won and back in the game, player 2 should leave the game Current players in the game: player le players player player Player 3 was elected as "it" DUCK DUCK DUCK DUCK DUCK DUCK DUCK DUCK GOOSE player7 playerse player playeraz player10 player player players players Player 6 was picked as goose RUN! player 6 won and back in the game, player should leave the game Current players in the game! player player player 10 Player 6 was elected as it DUCK DUCK GOOSE playere7 playeria player Player 7 was picked as goose RUN player 7 won and back in the game, player 6 should teave the gane Current players in the gamet player7 player10 Player 7 was elected as "it" DUCK DUCK DUCK DUCK DUCK DUCK GOOSE playerse player playerio player1e player le player10 playerie Player 10 was picked as goose RUN! "it" on, player 7 is back in the game, player 30 should leave the game Current players in the game! player Player 7 won the game! The simulator spent 305 ms

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

More Books

Students also viewed these Databases questions

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago