General Discussions

Arrays in C – Pros and Cons


Indian Bloggers

array

Set 01:
Pro: It can hold the collection of similar items
Con: It can hold the collection of similar items only

Set 02:
Pro: Memory allocated is continuous. You can increment the index to move to next element.  You can refer to any item in array using its index
Con: Memory allocated is continuous. If that required amount of memory is not continuously avail, well, problem!  Insertion and deletion in between the array are tedious to handle.

Set 03:
Pro: You can do operations on this homogeneous collection of items like sort, search, etc.
Con: If the size of data grows huge (Huge data as well as huge integer range), arrays are not the ideal data structures to be used.

Set 04:
Pro: Many other data structures can be implemented using arrays (Stack, Queue, Matrices etc)
Con: The static size and no direct bound checking mechanism is always a disadvantage

4 thoughts on “Arrays in C – Pros and Cons

Let me Know What you Think!