• 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 ...

Wednesday, July 13, 2011

Sample Program Reversing Integer Value

Because of slipshod work on the problems to be wrong. Today've just finished a course UAS algorithms and programming. There is a question that addresses the problem of reversing an integer value. Overnight taste already going out, but instead was not made. And it turns out real. Finally, not 100%, as pressed for time as well.

Now we will discuss the reverse problem. To our wasteful process like this:



r = r * 10 + n % 10
n = n / 10


r = save return value
n = integer number is entered

r = r * 10 + n % 10 will take the components one by one number, to do so it will be using a loop. n = n / 10 as a boundary loop.

Functions can be created like this:


Can be tried for the full program. Download HERE.

Jadilah yang pertama mengomentari

Post a Comment

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

To Up