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 17:00, Dweath50
1. so if i wanted to build a linux server for web services(apache) with 1cpu and 2 gb of memory.-operating at 75% of memory capacity2. a windows server with 2 cpu/ 4gb memory- operating at 85% of memory capacity3. a storage server with 1 cpu/ 2gb memory- operating at 85% of memory capacityhow much memory do i have to add for each server. so that the utilization rate for both cpu and memory is at a baseline of 60%."the details for the cpu like its processor or the memory's speed isnt to be concerned" yeah i kept asking my teacher if he's even sure about the but the whole class seems to be confused and the project is due in 3 days..this is a virtualization project where i have to virtualize a typical server into an exsi hypervisor.
Answers: 2
image
Computers and Technology, 22.06.2019 20:50, ashiteru123
What is the difference between windows 7 and windows 10?
Answers: 1
image
Computers and Technology, 24.06.2019 18:30, WATBOI01
What is the local portion of the e-mail address below? twrigley@gumchewer. biz a.) @ b.) biz c.) gumchewer d.) twrigley
Answers: 1
image
Computers and Technology, 24.06.2019 23:00, elha20
The valves of the heart and veins are similar in that they both
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:

Konu
Mathematics, 04.05.2021 20:40
Konu
Mathematics, 04.05.2021 20:40
Konu
Physics, 04.05.2021 20:40
Konu
Mathematics, 04.05.2021 20:40