ممكن مساعدة انا ااا بورطه
ومحتاجه شرح برنامج مع الرسم >><< وحل برنامجين >><<
>><<---------------------
هذا السؤال الي محتاج شرح ورسم
a linked list demonstration:
public class linkedlist1demo
}
public static void main (string[]args)
}
linkedlist list = new linkedlist():
list.addtostart("apples".1):
list.addtostart("bananas".2):
list.addtostart("cantaloupe".3):
system.out.println("list has"+list.size()+"nedes");
list.outputlist():
if (list.contains("cantaloupe")
system.out.println("cantaloupe is on list ");
else
system.out.println("cantaloupe is NOT on list ");
list.deleteHeadNode();
if (list.contains("cantaloupe")
system.out.println("cantaloupe is on list ");
else
system.out.println("cantaloupe is NOT on list ");
while(list.deleteHeadNode())
system.out.println("start of list :");
list.outputlist();
system.out.println("end of list.");
{
{
---------------------------------------
وهذا السؤالين الي محتااج حل
exercise 1
writ a recursive method definition for a stsic mathod that has one parameter n of type int
and that returns the nth fibonacci number .the fibonacci numbers are f0 is 1, f1 is 1,f2 is 2, f3 is 3,f4
is 5,and in general fi+2=fi+fi+1=0,1,2,...ect
place the method in aclass that has a main that tests the method
-------------------------------------------
exercise 2
write a recursive method to calculate the factorial of n, that
is n!, for example,4!=4ْx3!,3!=3x2x1. plac the
method in aclass that has amain that tests the method.
-----------------------------
وشاااكر لكم >><<