subject

Consider designing a data structure to represent the positions of 50 game pieces on a 100 x 100 gameboard. (The position of a game piece is the row and column number of the square that it is on.) Two alternatives are described below. Method 1: Use a two-dimensional array of Boolean values indexed by row and column number, where each array element represents one square of the gameboard. If there is a game piece on that square, then the array element is true; otherwise, the array element is false. Method 2: Use a one-dimensional array in which each element represents the position of one game piece (i. e., the row and column number of the square that it is on). Which of the following is true?a. Printing the positions of all game pieces can be done more efficiently by using Method 1 than by using Method 2.b. Determining whether there is a game piece on a particular square (given the row and column numbers) can be done more efficiently by using Method 2 than by using Method 1.c. Method 2 is not suitable if two game pieces can occupy the same square of the gameboard. d. Removing the game piece from a particular square (given its row and column numbers) can be done more efficiently by using Method 2 than by using Method1. e. Method 1 is not suitable if two game pieces can occupy the same square of the gameboard.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:30
Aprovides legal protection for something an individual has created
Answers: 1
question
Computers and Technology, 22.06.2019 09:30
What are the steps involved in accepting all the changes in a document? arrange these in order click edit. click accept or reject. click changes. click accept all.
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Spoons are designed to be used for: spring hammering. applying body filler. identifying high and low spots. sanding highly formed areas.
Answers: 3
question
Computers and Technology, 23.06.2019 19:40
Use a physical stopwatch to record the length of time it takes to run the program. calculate the difference obtained by calls to the method system.currenttimemillis() just before the start of the algorithm and just after the end of the algorithm. calculate the difference obtained by calls to the method system.currenttimemillis() at the start of the program and at the end of the program so that the elapsed time includes the display of the result. use the value returned by the method system.currenttimemillis() just after the end of the algorithm as the elapsed time.
Answers: 3
You know the right answer?
Consider designing a data structure to represent the positions of 50 game pieces on a 100 x 100 game...
Questions
question
Mathematics, 20.08.2019 18:20
question
Biology, 20.08.2019 18:20
question
Mathematics, 20.08.2019 18:20