āØ šš®š 2: ššæšæš®š, š®š ššæšæš®š, š šš¹šš¶š±š¶šŗš²š»šš¶š¼š»š®š¹-ššæšæš®šāØ
š What are arrays? In cases where there is a need to use several variables of same type, for storing, example, names or marks of ānā students we use a data structure called arrays. Arrays are basically collection of elements having same name and same data type. Using arrays, saves us from the time and effort required to declare each of the element of array individually. Creating an array The syntax for declaring an array is: Data_type array_name [ array_size ] ; Example : float marks[5]; Here, we declared an array, marks, of floating-point type and size 5. Meaning, it can hold 5 floating-point values. Similarly, we can declare array of type int as follows: int age[10]; How are arrays stored? The elements of arrays are stored contiguously, i.e., at consecutive memory locations. The name of the array actually has the address of the first element of the array. Hence making it possible to access any element of the array using the starting address. Example: int age[ ] = {10, 14, 16, 18, 19};
āļø šš¼šæ šÆš²ššš²šæ šš»š±š²šæššš®š»š±š¶š»š“ šæš²š³š²šæ š³š¼š¹š¹š¼šš¶š»š“ š®šæšš¶š°š¹š²š ;
š½ļø š§ššš¼šæš¶š®š¹ šš¶š»šøš;
šØāš» š¤šš²ššš¶š¼š»š¶š»š“ š„š¼šš»š± :
ā š² š½šæš¼š“šæš®šŗšŗš¶š»š“ š¾šš²ššš¶š¼š»š ā
ššæšæš®š
š®š ššæšæš®š
š šš¹šš¶š±š¶šŗš²š»šš¶š¼š»š®š¹ ššæšæš®š 1)https://www.hackerearth.com/practice/data-structures/arrays/multi-dimensional/practice-problems/algorithm/gift-for-almas-3-33d2f7c7/ 2)https://www.hackerearth.com/practice/data-structures/arrays/multi-dimensional/practice-problems/algorithm/binary-blocks-4b173d4a/