Computer Applications
Name the following:
(a) What is the main condition to perform binary search on an array?
(b) A sort method in which consecutive elements are NOT compared.
Related Questions
Give the output of the following program segment:
for(r=1;r<=3;r++) { for(c=1;c<r;c++) { System.out.println(r); } }Give the output of the following program segment:
void encode() { String s= "DICe"; char ch; for(i=0;i<4;i++) { ch=s.charAt(i); if("AEIOUaeiou".indexOf(ch)>=0) System.out.println("@"); else System.out.println(ch); }Answer the following:
(a) Scanner class method to accept a character.
(b) Jump statement which stops the execution of a construct.
How many times the given loop is executed? Give the output of the same.
for(k=10;k<=20;k+=4) { System.out.println(k); if(k%3==0) continue; }