When accessing datas using the Array Data Structure, the datas are called the elements in Array. Elements are declared into a single index container like, array[2, 3, 5].
We have 4 datas to be accesed in the structure which means we will have 4 elements. (*Think that the 4 datum are the 4 grades of 4 students in a class. The 4 grades has also 4 remarks each whether above average, average, below average depending on their grades.)
We named the four datas as: DATA_1, DATA_2, DATA_3, DATA_4 thus, we will have the syntax to declare as array[DATA_1, DATA_2, DATA_3, DATA_4]. Our flag pointer here is the name 'array' itself where all access of the 4 datas take place. When we input the DATA_1(first data) to the 'array', the array holds it until another data will come(DATA_2). Now, the 'array' holds 2 datas, we will add again another data(DATA_3) to the array and the last data(DATA_4) to the array also. This time the array holds 4 datas. When there's no more data to be added, the array will now index the datas which means each of the unique data will be processed. When all had been done, we wish to empty the array. We can choose which one should we emptied or it can be that all the datas will be emptied inside so that the array would be empty again and ready to contain another datas.
Monday, February 2, 2009
Subscribe to:
Posts (Atom)
