السلام عليكم أنا طالبة مبتدئه في الجافا أريد مساعدتكم في هذا البرنامج
بداية نعمل خوارزمية ثم نكتب البرنامج...المشكلة الأساسية معي أني أريد أحسب count ف binary search
بس م عارفه..مع العلم أن count هو number of iteration the program do it to find the searched element
فكرة البرنامج : أولا: ان المستخدم يدخل linear array ثم العنصر الي يبحث عنه ويطلع له count
ثانيا: المستخدم يدخل نفس array بس sorted عشان يطبق binary search ثم نفس العنصر الي بحث عنه سايقا ويطلع له count
هدف البرنامج: هو مقارنة بين linear search& binary search أيهم أسرع؟؟ من خلال الكاونت..
هذا هو السؤال:
Write a program that implement both linear search and binary search. You need to do the following :
1- Input an array.
2- Program should analyze both algorithms for above array
3- Output the Count.