Array : Reversing Array Element (Membalik Elemen Array)
Arrays are data structures that contain data types that have the same type. Arrays are also a bunch of memory-related (contiguous). Arrays have the same name and type. To refer to a particular location or element in the array à + name of the array index.
Arary following illustration
Array name
c[1]
|
-45
|
c[2]
|
6
|
c[3]
|
0
|
c[4]
|
72
|
c[5]
|
1543
|
Position number
Upon the memory we can modify it so that we can reverse the order of elements or numbers included in the array elements.
In the program we could use the swap, namely the exchange of array elements. For example:
Now how to implement into the programming language. We simply change the value element of an array. Ie having a smaller element is converted into a larger and elements that have a larger element is converted into smaller ones. So that the artifacts of a pattern and we can determine the recurrence formula.
I get the formula like this:
To better understand the longer I have to prepare a finished program. So that could be better understood anymore. Programs can be didownliad in here. check it bro!
Jadilah yang pertama mengomentari
Post a Comment