• Pada Algoritma pencarian banyak yang bisa kita temukan atau gunakan. Ada Merge Sort, Quick Sort, Bubble Sort, dan...
  • Pada dasarnya algoritma searching banyak kita jumpai. Apalagi hanya untuk mencari nilai minimum dan nilai maximum...
  • Kalian pasti sudah tahu apa itu Deret Fibonacci, ya benar. (Padahal gak jawab). Tetapi pada pembahasan kali ini kita akan membuar program...
  • Metoda Pencarian Biner ( Binary Search) hanya bisa diterapkan jika data array sudah terurut. Pengurutan Array bisa menggunakan jenis sorting ...
  • Salah satu contoh tipe algoritma brute force lainnya adalah linear search (pencarian berurutan), Dikatakan demikian karena algoritma ini menggunakan ...

Thursday, May 19, 2011

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

Tutorial Algorithm and Programming ©Template Blogger Green by Dicas Blogger.

To Up