1 / 7

Introduction to Arrays - IIMT Group of Colleges

Introduction to Arrays. An array is collection of items stored at contiguous memory locations. The idea is to store multiple items of same type together.

IIMTGroup
Télécharger la présentation

Introduction to Arrays - IIMT Group of Colleges

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Array ShomilBansal Asst. Prof. IIMT College of Management, Greater Noida

  2. What is Arrays? • An array is a group of consective memory locations with same name and data type. • Simple variableisasinglememory locationwithuniquenameandatype. But an Array is collection of different adjacent memory locations. All these memory locations have one collective name andtype. • The memory locations in the array are known as elements of array. Thetotal number of elements in the array is calledlength. • The elements of array isaccessed with reference to its position in array, that is call index orsubscript.

  3. Advantages / Uses ofArrays • Arrays can store a large number of value with singlename. • Arrays are used to process many value easily andquickly. • The values stored in an array can be sortedeasily. • The search process can be applied on arrayseasily.

  4. Types ofArrays: • One-DimensionalArray • Two-DimensionalArray • Multi-DimensionalArray

  5. One-DArray A type of array in which all elements are arranged in the form of a listis known as 1-D array or single dimensional array or linearlist. Declaring 1-DArray: data_typeidentifier[length]; e.g: intmarks[5]; • Data_type: • Identifier: • Length: Data type of values to be stored in thearray. Name of the array. Number ofelements.

  6. One-D arrayIntialization The process of assigning values to array elements at the time of array declaration is called arrayinitialization. Syntax: data_typeidentifier[length]={Listofvalues}; e.g: int array[5]={5,34,12,96,49}; • Data_type: • Identifier: • Length: Data type of values to be stored in thearray. Name of the array. Number ofelements oList of values: Values to initialize the array. Initializing values must be constant

  7. Greater Noida Campus IIMT Group of Colleges Plot No. 20-A, Knowledge Park III, Greater Noida, U P Tel: 0120 232 2655, 247 5000 Mob: 9911009144 Mob: 9717015300 Email:  enquires@iimtindia.net Thank You!!! REACH US 1. College website : www.iimtindia.net 2. College Social Media Links : https://www.facebook.com/iimtmeerutgreaternoida/ https://www.youtube.com/iimt-group-of-colleges https://www.instagram.com/iimtindia/

More Related