Posts

Showing posts with the label Advantages

LinkedList vs Array

Both type of data structure are used to store linear data of similar types. Though, both have some positive and negative sides. Advantages of linked list over array: 1. Dynamic Size                          As the size of array is fixed, we need to know the upper limit of number of elements in advance. But in practical use, number of elements are less than the upper limit so there is wastage of allocated memory. 2. Ease of Insertion / Deletion                                          In case of array it is difficult to insert or delete any element in middle of the array as for both insertion and deletion in array, we have to shift other elements to the right or left in the array Advantages of Array over Linked List: 1. Random access is allowed in array but random access is not allowed in Linked List. We hav...