資料結構題目的問題

Please give a discussion to compare the running situation of “Sequential List” and “Linked List” data structures in aspects of: (1)memory space, and (2)insert/delete data items

請問這題要怎麼解答?

1 個解答

評分
  • 5 年前
    最佳解答

    Please give a discussion to compare the running situation of “Sequential List” and “Linked List” data structures in aspects of: (1)memory space, and (2)insert/delete data items

    1. sequential list uses consecutive memory for the data items. So, (1) its memory space usage is fixed at the time when the list is defined. It is considered more memory efficient than "linked list". (2) however, if the list is arranged in any particular order, then insertion/deletion of an item into/from the list will require special operation to maintain the order.

    2. Linked list uses "pointers" (or indices) to maintain the sequence of the data items. (1) it needs to allocate more memory to store the "pointers" so it is less memory efficient in comparison to "sequential lists". (2) however, the pointers provide flexibility for insertion and deletion of data item. This makes the linked list operationally efficient.

    3. conclusions - for dynamic data items, link list is a better choice. For static data, sequential array makes more sense.

還有問題?馬上發問,尋求解答。