Kamis, 07 Juli 2011

Searching (Array One Dimension) : Finding a Number From Several Numbers



Still talking one-dimensional array problem. In the array much to do kit. From the most minor sort the numbers to the greatest or from greatest to smallest. Also we will discuss this time is to find a number of the many numbers entered.


For example there is input data 5, 6, 2, 4, 8. 5 will automatically be stored in the array index of 1, 6 will be stored in the array index 2, 2 will be stored in the array index of 3, 4 will be stored in the array index 4, 8 will be stored in the array index 5, with our record array indices start from 1 . Because the default array index starts from 0.


Because there is an array index we can find a number that is located on an array index. As an example we look for number 2. Algorithm that is where all the numbers look the same with blangan to be searched. If you've met the index of an array of printing as a result of the position of the storage array. So number 2 is located at position 3 of a series that included bilagan.


The program can be created like this :

Blog ini Di-link Dari Sini Web
Blog ini