What are the advantages and disadvantages of array?
Advantages of Array:
- An array implementation allows Print to be carried out in linear time and FindKth operation in constant time, which is good as can be expected
- Random access is possible
- Implementation of list using array is easier as compared to other implementations
Disadvantages of
Array:
- Elements of arrays are always stored in contiguous memory
- Inserting or deleting an element in an array may require all of its elements to be shifted
- The size of array is always fixed
- You cannot add a new element beyond the end of the array
- Memory for the entire array is always reserved even though you use only part of the array
- You must guess the expected maximum size of the list in advance
0 comments:
Feel free to contact the admin for any suggestions and help.