August 17, 2021 at 12:08 pm #6305
You have been taske with creating a board game, example chess, you have a choice of between 2 data strucre, array or linked list, explain which you would use and why. You answer should highlight the salient differences in the 2 data structuresAugust 18, 2021 at 10:14 am #6334girwanParticipant
I choose an array because contents of an array can be accessed faster than linked list. Array elements are also independent of each other unlike linked list. They also require less memory per element as arrays don’t make use of nodes.August 18, 2021 at 5:35 pm #6336joshua7Participant
I would choose an array. First of all, the array is independent allowing it to be accessed randomly. This means that it is also quicker to be accessed compared to a linked list. Reversing is also not possible in a linked list. Lastly there are less memory required in an array which makes it a good fit for creating a board game.August 19, 2021 at 1:27 am #6340
Memory and access speed good.
Array elements are also independent of each other unlike linked list… what does this mean ?
Also we knwo at the begiining it will be a fixed size which is perfect for an array structure..
Can you redo answer peaseAugust 19, 2021 at 1:29 am #6341
I would choose an array.
First of all, the array is independent allowing it to be accessed randomly. access correct, but what do you mean by independent
This means that it is also quicker to be accessed compared to a linked list.
Reversing is also not possible in a linked list. What do you mean by reversing ?
Lastly there are less memory required in an array which makes it a good fit for creating a board game. goodAugust 19, 2021 at 2:00 am #6343Shiva ChandnaniParticipant
I would use an array to make my board game, or more specifically a two-dimensional array. I chose an array firstly because elements can be accessed faster compared to a linked list due to the reduced memory. Secondly, in an array, it is more difficult to add or remove elements, however, this is an advantage in this situation since board games as well have a fixed list of elements and don’t require changes.August 19, 2021 at 2:50 am #6361SangParticipant
I would choose array as well because it uses less memory and also array allows random accessAugust 19, 2021 at 3:28 am #6362
very good,,, but think again about why elements can be accessed faster is it reduced memory or because they are contiguous ?August 19, 2021 at 3:31 am #6363
Good Sang, please explain how it allows random // direct access (both the same)August 19, 2021 at 5:37 pm #6402IrfanParticipant
Array. Because an array is faster to access. And it won’t be confusing because of the changes made in a linked list would be cofnusing but in a array it would be easier to understand even after the changes.
- You must be logged in to reply to this topic.