You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Array.md
+14-2Lines changed: 14 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,19 @@ Array may be defined abstractly as finite order set of homogeneous elements. So
9
9
10
10
## Content
11
11
*[Why do we need array?](#why-do-we-need-array)
12
+
*[Advantages of array](#advantages-of-array)
12
13
*[How to declare an array?](#how-to-declare-an-array)
14
+
*[How to initialize an array](#how-to-initialize-an-array)
15
+
*[Memory allocation of array](#memory-allocation-of-array)
16
+
*[Properties of array](#properties-of-array)
17
+
*[How to access elements of array](#how-to-access-elements-of-array)
18
+
*[Basic operations on array](#basic-operations-on-array)
19
+
-[Traversing](#traversing)
20
+
-[Insertion](#insertion)
21
+
-[Deletion](#deletion)
22
+
-[Searching](#searching)
23
+
-[Update](#update)
24
+
*[Conclusion](#conclusion)
13
25
14
26
## Why do we need array?
15
27
In computer programming, the most of the cases requires to store the large number of data of similar type. To store such amount of data, we need to define a large number of variables. It would be very difficult to remember names of all the variables while writing the programs. Instead of naming all the variables with a different name, it is better to define an array and store all the elements into it.
@@ -52,7 +64,7 @@ All the data elements of an array are stored at contiguous locations in the main
52
64
* Elements of the array are stored at contiguous memory locations where the first element is stored at the smallest memory location.
53
65
* Elements of the array can be randomly accessed since we can calculate the address of each element of the array with the given base address and the size of data element.
54
66
55
-
## How to access elements of Array
67
+
## How to access elements of array
56
68
You can access elements with the help of the index at which you stored them.
57
69
58
70
Suppose you declared an array a as above. The first element is a[0], the second element is a[1] and so on.
@@ -61,7 +73,7 @@ Suppose you declared an array a as above. The first element is a[0], the second
61
73
printf(“%d\n”,a[0]);
62
74
```
63
75
64
-
## Basic operation on array
76
+
## Basic operations on array
65
77
Following are the basic operations supported by an array.
0 commit comments