At the sixth meeting we discussed about rekursif.Fungsi recursive function that does theloop by calling itself.
This time we play games, and the game we were told to forward some of the peopledepend lecturers and statements to be played in the game.
And now my fault should forward diurutan number 5, well I almost forgot to mention when the last words whispered by my friend. The game is exciting .. : D
Every recursive function contains two terms:
1. the simplest case or base case. in it will contain a value.
2. step recursive (recursive call), where a complex problem is broken down into simple problems. This recursive step should lead to case basis.

An example is a program to find the value of n! with n integer non negatif.n! defined as:(integer)
                             n! = N * (n-1) * (n-2) * … * 1
with 1! = 1 and 0! = 1. This problem can be solved by an iterative manner using thestatement for. Let n be the search n!

faktorial = 1
for(int i=1; i<n; i++)
faktorial = faktorial*i;
Definition of the factorial can be written by the relation : (rekursif)
                                n! = n*(n-1)!
writen as : 
            faktorial := n* faktoria(n-1);

About niehennys

just another girl.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:


You are commenting using your account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )


Connecting to %s