Array: Array is a
Data Structure defined by the programmers/users that store data items of the same
type sequentially i.e. an array contains data items of the same type and all these
items are stored sequentially in memory. It is one of the most common user-defined data types used by the programmers.
In this, size of the array needs to be specified during array initialization.
To access
data item at any index, we use array indexing like:
Syntax:
type Array-name[index] // Array-name to be declared by user and type is a type of data to be stored
To access data item at index 2, we write:
type Array-name[2].
Array is widely used by the
programmers because:
It is easy
to implement.
As data
items are stored sequentially and so can be accessed by array indexing in O(1)
time complexity.
Note: here type refers to what type of
data to be stored in the array.
Cheers! Please let me know if you have any queries or feedback on this.
Related common questions: Whats an Array?, Why we use Array?, Use of Array?, What is an Array?
Really helpful
ReplyDeleteThanks for your valuable feedback!
DeleteNice article
ReplyDeleteThanks for your valuable feedback!
DeleteVery helpful
ReplyDeleteVery helpfull.
ReplyDeleteVery helpfull.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThanks for your valuable feedback!
DeleteVery helpful.
ReplyDeleteThanks for your valuable feedback!
DeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by the author.
ReplyDeletegood explanation
ReplyDeleteThanks for your valuable feedback!
DeleteđŸ’¯đŸ’¯understandable content
ReplyDeleteThanks for your valuable feedback!
DeleteNicely Explained
ReplyDeleteThanks for your valuable feedback!
DeleteCool stuff
ReplyDeleteThanks for your valuable feedback!
DeleteHelpful
ReplyDeleteThanks for your valuable feedback!
Delete