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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:00, sere50
Stacy works as blank. the most important soft skill she needs for this role is blank.
Answers: 3
image
Computers and Technology, 23.06.2019 02:30, jaueuxsn
Which component acts as a platform on which application software runs
Answers: 2
image
Computers and Technology, 23.06.2019 16:00, natasniebow
Kenny works with an it company. his company is about to launch new software in the market. he has to ensure that this new software is functional and meets all of the quality standards set up at the planning stage. which job profile is kenny likely to have? kenny is likely to have the job profile of a blank .
Answers: 2
image
Computers and Technology, 23.06.2019 16:30, rileysndr1782
Monica and her team have implemented is successfully in an organization. what factor leads to successful is implementation? good between different departments in an organization leads to successful is implementation.
Answers: 1
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 in other subjects: