given an unsorted array of n elements find if the element k is present in the array or not program in c
Answers
Answered by
0
an unsorted array=k and c
Ayushjisingh:
accha lage to brainlist karna
Answered by
0
class find{
public static void main(String[] args){
char[] cvalue = {'a', 'x', 'k', 'l', 'm', 'p', 'i', 'o', 'y', 'h', 'j', 'b', 'g', 'f', 't', 'r'};
char toFind = 'k';
boolean helpfind = Arrays.stream(cvalue).anyMatch ( t-> t.equals (tofind));
if(helpfind)
System.out.println( tofind + "is found" );
else
System.out.println(tofind + "is not found");
}
}
This is the program that can be used the get the drsied output: To arrange the unsorted array of elements by giving a value to k, which is the variable here.
Similar questions
Business Studies,
7 months ago
World Languages,
7 months ago
Math,
7 months ago
Geography,
1 year ago
Physics,
1 year ago
Math,
1 year ago
English,
1 year ago
Social Sciences,
1 year ago