Skip to main content

Posts

Showing posts with the label recurssive

lecture 8

RULES OF DOUBLE ENTRY SYSTEM PERSONAL A/C - DR. THE DEBTOR                                           CR. THE CREDITOR REAL A/C - DR. WHAT COMES IN                                 CR. WHAT GOES OUT  NOMINAL A/C -  DR. ALL EXPENSES AND LOSSES                                           CR. ALL INCOMES AND GAINS  PRACTICAL QUESTIONS CASH BORROWED FROM KAPIL RS. 10,000 CASH A/c  TO KAPIL  MONEY LENT TO SACHIN RS. 2,000 SACHIN A/c TO CASH A/c FURNITURE PURCHASED RS. 1,000 FURNITURE A/c TO CASH A/c GOODS PURCHASED RS. 3,000 PURCHASES A/c TO CASH A/c SALARY PAID TO VERU RS. 500 SALARY A/c TO CASH A/c

towers of hanoi

Towers Of  Hanoi // to move all disks from peg 1 to peg 3 // you just have to move n-1 disks to peg2 // and then nth disk to peg 3 // and then n-1 disks to peg 3 towers(ndisks,source,temp,destination,) if(ndisks <>0) { towers(ndisks-1,source, destination,temp) move  disk from source to destination towers(ndisks-1,temp,source, destination) }