Data Structures

Home Forums IB Pseudo Code Data Structures

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #6305
    Eamonn
    Keymaster

    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 structures

    #6334
    girwan
    Participant

    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.

    #6336
    joshua7
    Participant

    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.

    #6340
    Eamonn
    Keymaster

    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 pease

    #6341
    Eamonn
    Keymaster

    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. good

    #6343
    Shiva Chandnani
    Participant

    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.

    #6361
    Sang
    Participant

    I would choose array as well because it uses less memory and also array allows random access

    #6362
    Eamonn
    Keymaster

    very good,,, but think again about why elements can be accessed faster is it reduced memory or because they are contiguous ?

    #6363
    Eamonn
    Keymaster

    Good Sang, please explain how it allows random // direct access (both the same)

    #6402
    Irfan
    Participant

    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.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.
Scroll to Top