0

Can anyone will be able to provide me a program of binary search of arrays in Java ? Please help somebody. 🙏🙏

What is the mistake here? Why is the program not running? Please look into it. https://code.sololearn.com/ca5MgRZj25M0/?ref=app

23rd Aug 2022, 1:48 PM
Lørd Ãsh
11 Réponses
0
So kindly please correct it tomorrow is my exam that's why I need it urgent. And please reply as soon as possible.
23rd Aug 2022, 2:49 PM
Lørd Ãsh
+ 2
You can see the mistakes in compiler messages and make it better.
23rd Aug 2022, 2:03 PM
JaScript
JaScript - avatar
+ 1
Ya, But I'm not to able to figure out what should I do, actually I'm a beginner 😔😔
23rd Aug 2022, 2:09 PM
Lørd Ãsh
+ 1
🙃🙃🙃
23rd Aug 2022, 3:14 PM
Lørd Ãsh
+ 1
So you may not understand how to correct the code, even if I say.. Otherwise I may try. Read the links then try your own code.
23rd Aug 2022, 3:22 PM
Jayakrishna 🇮🇳
0
Without attempting step 1, attempting step 10 ? Anybody need to complete the basics first.. Your array declaration is wrong. And Mainly : In java, execution starts from main method. You don't have main method to start run the code!!! So it won't run.
23rd Aug 2022, 2:41 PM
Jayakrishna 🇮🇳
0
That's not correct way to bother in the last minute. It may take some days to understand. Anyways , hope this simplifies: Array declaration correct way is : int arr[] = new int [ <size> ]; And about binary seach : https://www.sololearn.com/learn/664/?ref=app https://www.sololearn.com/learn/764/?ref=app Call your binary seach method in main method by adding : public static void main(String a[]) { Search( < number > ); // ex: search(5); }
23rd Aug 2022, 3:08 PM
Jayakrishna 🇮🇳
0
Thanks a lot
23rd Aug 2022, 3:09 PM
Lørd Ãsh
0
Is that your own code?
23rd Aug 2022, 3:13 PM
Jayakrishna 🇮🇳
0
Yeah
23rd Aug 2022, 3:14 PM
Lørd Ãsh
0
Copied from my friend
23rd Aug 2022, 3:14 PM
Lørd Ãsh