![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 05.11.2020 19:10 cherkaouinazihp387bk
Write a recursive, boolean -valued method named search that accepts an integer array , the number of elements in the array , and an integer (in that order), and returns whether the integer is present as an element in the array . Searching for a particular value in an array can be performed in the following recursive manner:
If the array has no elements , the value is not there.
Compare the first element of the array to the value , if they're equal , the value is there; other search for the value in the rest of the array .
My program is..
public boolean search(int arr[],int n, int m){
if(n==0){
return false;
}
if(arr[n]==m){
return true;
}
n=n-1;
return search(arr[],n-1,m);
}
but I recieve a compiler error CTest. java:10: error: '.class' expected
what am I doing wrong?
![ansver](/tpl/images/cats/User.png)
Answers: 3
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 18:00
Budgets you to do all of the following expect a) send frivolously b) avoid over spending c) gain financial independence d) examine your priorities and goals
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 23:00
Is an attack that relies on guessing the isns of tcp packets
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 11:00
Which of the statements below describe the guidelines for the use of text in presentation programs? a. do not use numbered lists. b. fonts should be appropriate for your audience. c. limit the number of fonts you use to three or four. d. only use bulleted lists for sales promotions. e. select font sizes that are appropriate for your delivery method. f. use font colors that work well with your background. select all that apply
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 12:30
Why does the pc send out a broadcast arp prior
Answers: 1
You know the right answer?
Write a recursive, boolean -valued method named search that accepts an integer array , the number of...
Questions
![question](/tpl/images/cats/ap.png)
Advanced Placement (AP), 04.09.2020 01:01
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 04.09.2020 01:01
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/biologiya.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/en.png)
English, 04.09.2020 01:01
![question](/tpl/images/cats/User.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 04.09.2020 01:01
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/en.png)
English, 04.09.2020 01:01
![question](/tpl/images/cats/fizika.png)
Physics, 04.09.2020 01:01
![question](/tpl/images/cats/User.png)
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/geografiya.png)
Geography, 04.09.2020 01:01
![question](/tpl/images/cats/istoriya.png)
History, 04.09.2020 01:01
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/fizika.png)
Physics, 04.09.2020 01:01