Can anyone will be able to provide me a program of binary search of arrays in Java ? Please help somebody. šŸ™šŸ™ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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 Answers
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