Advantages and disadvantages of Array?

Advantages and disadvantages of Array?

Add Comment


  • 4 Answer(s)

    Advantages and Disadvantages of Array:

    Advantages

    • It is better and convenient way of storing the data of same datatype with same size.
    • It allows us to store known number of elements in it.
    • It allocates memory in contiguous memory locations for its elements. It does not allocate any extra space/ memory for its elements. Hence there is no memory overflow or shortage of memory in arrays.
    • Iterating the arrays using their index is faster compared to any other methods like linked list etc.
    • It allows to store the elements in any dimensional array – supports multidimensional array.

    Disadvantages

    • It allows us to enter only fixed number of elements into it. We cannot alter the size of the array once array is declared. Hence if we need to insert more number of records than declared then it is not possible. We should know array size at the compile time itself.
    • Inserting and deleting the records from the array would be costly since we add / delete the elements from the array, we need to manage memory space too.
    • It does not verify the indexes while compiling the array. In case there is any indexes pointed which is more than the dimension specified, then we will get run time errors rather than identifying them at compile time.
    Answered on February 18, 2019.
    Add Comment

    Arrays are basically a collection of similar type of data in a contiguous memory location under one name.

    Advantages-

    collection of similar types of data.
    if we want to store the marks of all students it will easy to store in array otherwise we have to store marks in different different location, which is not easy to memorise.
    we have to only remember the first index of array.
    used to implement other data structure like linked lists,stack,queue, trees, graph etc.
    2 Dimensional array is used to represent a matrix.
    DISADVANTAGES
    Time complexity increase in insertion and deletion operation.
    wastage of memory because arrays are fixed in size.
    if there is enough space present in the memory bt not in contiguous form , in this case you will not able initialize your array.
    it is not possible to increase the size of the array, once you had declared the array.
    10.6k Views ยท
    Advantages:

    It is used to represent multiple data items of same type by using only single name.
    It can be used to implement other like linked lists, stacks, queues, trees, graphs etc.
    2D arrays are used to represent matrices.
    Disadvantages:

    We must know in advance that how many elements are to be stored in array.
    Array is static structure. It means that array is of fixed size. The memory which is allocated to array can not be increased or reduced.
    Since array is of fixed size, if we allocate more memory than requirement then the memory space will be wasted. And if we allocate less memory than requirement, then it will create problem.
    The elements of array are stored in consecutive memory locations. So insertions and deletions are very difficult and time consuming.

    Answered on February 18, 2019.
    Add Comment
    • ADVANTAGES:
    • Multiple data items of same data type can be accessed using single name
    • Arrays can be used to implement matrices
    • Data structure like queue , linked list can be accessed using arrays
    • DISADVANTAGES:
    • We must know in advance that how many elements are to be stored in an array
    • Array is static structure. It means that array is of fixed size. The memory which is allocated to array can not be increased or reduced.
    • Insertion and deletion are quite difficult in array. As the elements are stored in consecutive memory locations.
    Answered on February 19, 2019.
    Add Comment

    Advantages-

    • collection of similar types of data.
    • if we want to store the marks of all students it will easy to store in array otherwise we have to store marks in different different location, which is not easy to memorise.
    • we have to only remember the first index of array.
    • used to implement other data structure like linked lists,stack,queue, trees, graph etc.
    • 2 Dimensional array is used to represent a matrix.
      • DISADVANTAGES
    • Time complexity increase in insertion and deletion operation.
    • wastage of memory because arrays are fixed in size.
    • if there is enough space present in the memory bt not in contiguous form , in this case you will not able initialize your array.
    • it is not possible to increase the size of the array, once you had declared the array.
    Answered on February 21, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.