0% found this document useful (0 votes)
153 views2 pages

Array Basics and Operations Guide

An array is a data structure that can hold a fixed number of elements of the same type. It uses indexes to identify each element, with indexing starting at 0. Arrays are commonly used to implement algorithms in other data structures. An array declaration example in C shows an array with length 8 to store 8 integer elements, each accessible by its index. Basic array operations include traversing elements, inserting and deleting by index, searching by index or value, and updating elements.

Uploaded by

Muhammad Daud
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
153 views2 pages

Array Basics and Operations Guide

An array is a data structure that can hold a fixed number of elements of the same type. It uses indexes to identify each element, with indexing starting at 0. Arrays are commonly used to implement algorithms in other data structures. An array declaration example in C shows an array with length 8 to store 8 integer elements, each accessible by its index. Basic array operations include traversing elements, inserting and deleting by index, searching by index or value, and updating elements.

Uploaded by

Muhammad Daud
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Array is a container which can hold a fix number of items and these items

should be of the same type. Most of the data structures make use of arrays
to implement their algorithms. Following are the important terms to
understand the concept of Array.

 Element − Each item stored in an array is called an element.

 Index − Each location of an element in an array has a numerical


index, which is used to identify the element.

Array Representation
Arrays can be declared in various ways in different languages. For
illustration, let's take C array declaration.

As per the above illustration, following are the important points to be


considered.

 Index starts with 0.

 Array length is 8 which means it can store 8 elements.

 Each element can be accessed via its index. For example, we can fetch
an element at index 6 as 9.
Basic Operations
Following are the basic operations supported by an array.

 Traverse − print all the array elements one by one.

 Insertion − Adds an element at the given index.

 Deletion − Deletes an element at the given index.

 Search − Searches an element using the given index or by the value.

 Update − Updates an element at the given index.

You might also like