الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

تكفون مساعدة>><<

بدأه مــــيو في 15 أغسطس 2008 · 2 رد · 431 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

>><<مساء الخير>><<

ممكن مساعدة انا ااا بورطه :wacko: عندي اختباار بكر السبت

ومحتاجه شرح برنامج مع الرسم >><< وحل برنامجين >><<

:blush: :blush: ممكن بليـــــز تساعدوني

>><<---------------------

هذا السؤال الي محتاج شرح ورسم

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.

-----------------------------

وشاااكر لكم >><< :blush: :blush:

#2

السلام عليكم اختي //

المنتدى ليس لحل الواحبات , ولكن للمساعدة في تطوير القدرات العلمية , والمنطق ان ترينا ما انجزتييه حتى نساعدك ..

لكن لانك تقولين ان غدا عندك امتحان سأحاول المساعدة ..

linkedlist list = new linkedlist():

قمننا هنا بتعريف Object من نوع LinkedList , وهذا الشيء هو نوع من الطرق التخزينية الديناميكية للذاكرة , بحيث يتم حجز عناوين في الذاكرة على حسب الحاجة , وليس مثل Arrays التي يتم حجز عدد من الأماكن التخزينية بغض النظر عن ما إذا كنا نريد ان تستخدمها أو لا .

list.addtostart("apples".1):
list.addtostart("bananas".2):
list.addtostart("cantaloupe".3):

في الجمل السابقة , قمنا بعملية اضافة لهذه السلسة الديناميكية وهي LinkedList , حيث اضفنا في بداية السلسة apples وبالتحديد في اول مكان تخزيني في السلسة , وبعدها اضفنا في المكان التخزيني الثاني bananas , وهكذا الثالثة .

list.outputlist():

حتى تقوم بطباعة عناصر السلسة

if (list.contains("cantaloupe")

system.out.println("cantaloupe is on list ");
else
system.out.println("cantaloupe is NOT on list ");

شرط , لفحص ماإذا السلسلة تحتوي على cantaloupe , فإذا كان كذلك , يحب ان يطبع البرنامج الحملى الأولى , و إلا فليقم بطباعة الجملة الثانية .

list.deleteHeadNode();

حتى يحذف العنصر الأول من السلسلة .

if (list.contains("cantaloupe")
system.out.println("cantaloupe is on list ");
else
system.out.println("cantaloupe is NOT on 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

public int fib(int i)
{
	if(i == 0 || i == 1)
		return 1;

	else
		return fib(i-1) + fib(i-2);
}

اقتباس

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

public int fact(int i)
{
	if(i == 1 || i == 2)
		return i;
	else
		return  i * fact(i-1);
}
#3

مشكور اخوووي الله يوقفك ويقرج كربتك يااارب >><< بجد فرجت كربتي مشكوووور اخوي

:blush: :blush:

مواضيع مشابهة