Practice question
3 marksWrite a Java program segment to count the words in a sentence s that has single spaces between words.
Class 12 Computer ScienceString HandlingMediumApplication based
Every question, by chapter, year, marks and type.Every question, filterable by class, subject, chapter, topic, year, marks, difficulty, type and source. The filters live in the address, so any view you build can be shared.
58 questions
Practice question
3 marksWrite a Java program segment to count the words in a sentence s that has single spaces between words.
Class 12 Computer ScienceString HandlingMediumApplication based
Practice question
3 marksHow many elements are there in a two-dimensional array declared as int a[5][4], and how much memory does it occupy if an int takes 4 bytes?
Class 12 Computer ScienceArraysMediumNumerical
Practice question
3 marksName three applications of a stack.
Class 12 Computer ScienceStacksMediumShort answer
Practice question
3 marksState the worst-case number of comparisons made by bubble sort on an array of n elements.
Class 12 Computer ScienceArraysMediumNumerical
Practice question
3 marksState three differences between the String and the StringBuffer classes.
Class 12 Computer ScienceString HandlingMediumShort answer
Practice question
3 marksWrite a Java program segment to search for a value v in a sorted array a of size n using binary search.
Class 12 Computer ScienceArraysMediumApplication based
Practice question
3 marksWrite a recursive Java method to reverse a string.
Class 12 Computer ScienceRecursionMediumApplication based
Practice question
3 marksDistinguish between an encoder, a decoder and a multiplexer.
Class 12 Computer ScienceCombinational and Sequential Logic CircuitsMediumShort answer
Practice question
3 marksA class B extends class A, and both define a method show(). If A a = new B(); a.show(); is executed, which version runs and why?
Class 12 Computer ScienceInheritance and PolymorphismMediumNumerical
Practice question
3 marksWhy are constants and lower-order terms dropped from a big O expression?
Class 12 Computer ScienceComplexity and Big O NotationMediumShort answer
Practice question
3 marksWhat does the super keyword do in Java?
Class 12 Computer ScienceInheritance and PolymorphismMediumShort answer
Practice question
3 marksWrite a Java program segment to count the number of vowels in a given string s.
Class 12 Computer ScienceString HandlingMediumApplication based
Practice question
3 marksState the time complexity of the following and justify it: for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) sum++;
Class 12 Computer ScienceComplexity and Big O NotationMediumNumerical
Practice question
3 marksReduce F(A, B, C, D) = Σ(0, 2, 8, 10) using a Karnaugh map.
Class 12 Computer ScienceKarnaugh MapsMediumNumerical
Practice question
3 marksWrite a recursive Java method to find the greatest common divisor of two positive integers.
Class 12 Computer ScienceRecursionMediumApplication based
Practice question
3 marksWhat is a circular queue and what problem does it solve?
Class 12 Computer ScienceQueuesMediumShort answer
Practice question
3 marksState and verify the absorption law X + X·Y = X using a truth table.
Class 12 Computer ScienceBoolean AlgebraMediumStructured
Practice question
3 marksWhat is the output of: String s = "Programming"; System.out.println(s.indexOf('g') + " " + s.lastIndexOf('g') + " " + s.replace('g', 'G'));
Class 12 Computer ScienceString HandlingMediumNumerical
Practice question
3 marksState the rules for forming groups on a Karnaugh map.
Class 12 Computer ScienceKarnaugh MapsMediumShort answer
Practice question
3 marksA stack of capacity 5 is empty. After push(1), push(2), push(3), pop(), push(4), pop(), pop(), what is left on the stack?
Class 12 Computer ScienceStacksMediumNumerical