The language of all non-null strings of a’s can be defined by a context free grammar as follow : S→a S|S a| a The word a3 can be generated by ................ different trees. (A) Two (B) Three (C) Four (D) Five

1 Answer

Answer :

(C) Four

Explanation:

image

Related questions

Description : The Greibach normal form grammar for the language L={an bn+1|n≥0} is (A) S→a SB, B→bB|λ (B) S→a SB, B→bB|b (C) S→a SB|b, B→b (D) S→a Sb|b

Last Answer : (C) S→a SB|b, B→b 

Description : The number of strings of length 4 that are generated by the regular expression (0|∈) 1+2* (3|∈), where | is an alternation character, {+, *} are quantification characters, and ∈ is the null string, is: (A) 08 (B) 10 (C) 11 (D) 12

Last Answer : (D) 12

Description : If all the production rules have single non - terminal symbol on the left side, the grammar defined is : (A) context free grammar (B) context sensitive grammar (C) unrestricted grammar (D) phrase grammar

Last Answer : (A) context free grammar

Description : Given the following statements : S1 : SLR uses follow information to guide reductions. In case of LR and LALR parsers, the look-aheads are associated with the items and they make use of the left context available to ... (C) S1 is correct and S2 is not correct. (D) S1 is correct and S2 is correct.

Last Answer : (D) S1 is correct and S2 is correct.

Description : Which of the following is FALSE ? (A) The grammar S ⟶ aSb|bSa|SS|∈, where S is the only non-terminal symbol and ∈ is the null string, is ambiguous. (B) SLR is powerful than LALR. (C) An LL(1) parser is a top-down parser. (D) YACC tool is an LALR(1) parser generator.

Last Answer : (B) SLR is powerful than LALR.

Description : The context free grammar for the language L = {an bm | n≤m+3, n≥0, m≥0} is (A) S→aaaA; A→aAb|B, B→Bb|λ (B) S→aaaA|λ, A→aAb|B, B→Bb|λ (C) S→aaaA|aaA|λ, A→aAb|B, B→Bb|λ (D) S→aaaA|aaA|aA|λ, A→aAb|B, B→Bb|λ

Last Answer : (D) S→aaaA|aaA|aA|λ, A→aAb|B, B→Bb|λ

Description : Which is the correct statement(s) for Non Recursive predictive parser? S1: First(α) = {t | α => * t β for some string β } => *tβ S2: Follow(X) = { a | S => * αXa β for some strings ... and S2 is correct. (C) S1 is correct and S2 is incorrect. (D) Both statements S1 and S2 are correct. 

Last Answer : (D) Both statements S1 and S2 are correct.

Description : For every context free grammar (G) there exists an algorithm that passes any w ∈ L(G) in number of steps proportional to (A) ln|w| (B) |w| (C) |w|2 (D) |w|3

Last Answer : (D) |w|3

Description : A context free grammar for L={w|n0(w)>n1(w)} is given by: (A) S→0|0S|1SS (B) S→0S|1S|0SS|1SS|0|1 (C) S→0|0S|1SS|S1S|SS1 (D) S→0S|1S|0|1

Last Answer : (C) S→0|0S|1SS|S1S|SS1 

Description : The number of strings of length 4 that are generated by the regular expression (0+1 +|2+3 + )*, where | is an alternation character and {+, *} are quantification characters, is: (A) 08 (B) 09 (C) 10 (D) 12

Last Answer : (C) 10

Description : Let L be the language generated by regular expression 0*10* and accepted by the deterministic finite automata M. Consider the relation RM defined by M. As all states are reachable from the start state, RM has ................ equivalence classes. (A) 2 (B) 4 (C) 5 (D) 6

Last Answer : (D) 6

Description : Which of the following statement is not true? a) The union and concatenation of two context-free languages is context-free b) The reverse of a context-free language is context-free, but the ... it can be described by a regular grammar d) The intersection two context-free languages is context-free

Last Answer : d) The intersection two context-free languages is context-free

Description : Which of the following statement is not true? a) The union and concatenation of two context-free languages is context-free b) The reverse of a context-free language is context-free, but ... a regular language is always context-free e) The intersection two context-free languages is context-free

Last Answer : e) The intersection two context-free languages is context-free

Description : The grammar with production rules S → aSb |SS|λ generates language L given by: (A) L = {w∈{a, b}* | na(w) = nb(w) and na(v) ≥ nb(v) where v is any prefix of w} (B) L = {w∈{a, b}* | na(w) = nb(w) and na(v ... (D) L = {w∈{a, b}* | na(w) ≠ nb(w) and na(v) ≤ nb(v) where v is any prefix of w}

Last Answer : (A) L = {w∈{a, b}* | na(w) = nb(w) and na(v) ≥ nb(v) where v is any prefix of w} 

Description : Which one of the following is true? (A) The resolvent of two Horn clauses is not a Horn clause. (B) The resolvent of two Horn clauses is a Horn Clause. (C) If we resolve a negated goal G against a ... negated goal G against a fact or rule A to get clause C then C has positive literal or null goal. 

Last Answer : (B) The resolvent of two Horn clauses is a Horn Clause.

Description : Given the following two statements: A. L = {w|na(w) = nb(w)} is deterministic context free language, but not linear B. L = {an bn} U {an b2n} is linear, but not deterministic context free language. Which of the following ... are true. (3) (A) is true, (B) is false. (4) (A) is false, (B) is true.

Last Answer : Both (A) and (B) are true. 

Description : Given the following two languages: L1 = {anbn|n≥0, n≠100} L2 = {w ϵ {a,b,c}*| na(w) = nb(w) = nc(w)} Which of the following options is correct? (1) Both L1 and L2 are ... context free language, L2 is not context free language. (4) L1 is not context free language, L2 is context free language.

Last Answer : L1 is context free language, L2 is not context free language.

Description : Shift-Reduce parsers perform the following : (A) Shift step that advances in the input stream by K(K>1) symbols and Reduce step that applies a completed grammar rule to some recent parse trees, ... in the input stream and Reduce step that applies a completed grammar rule to form a single tree.

Last Answer : (B) Shift step that advances in the input stream by one symbol and Reduce step that applies a completed grammar rule to some recent parse trees, joining them together as one tree with a new root symbol.

Description : In a relational database model, NULL values can be used for all but which one of the following? (A) To allow duplicate tuples in the table by filling the primary key column(s) with NULL. (B) To ... D) To fill a column in a tuple when that column does not really exist for that particular tuple.

Last Answer : (A) To allow duplicate tuples in the table by filling the primary key column(s) with NULL.

Description : Consider the following statements related to compiler construction: I. Lexical Analysis is specified by context-free grammars and implemented by pushdown automata. II. Syntax Analysis is specified by regular expressions and implemented by ... Only l (2) Only ll (3) Both I and II (4) Neither I nor Il

Last Answer : Answer: 4

Description : What is defined by a set of strings? a) Signs b) Formal language c) Communication

Last Answer : b) Formal language

Description : Given the following statements: S1: Every context-sensitive language L is recursive. S2: There exists a recursive language that is not context sensitive. Which statement is correct? (A) S1 is not correct and S2 is ... (C) S1 is correct and S2 is not correct. (D) S1 is correct and S2 is correct.

Last Answer : (D) S1 is correct and S2 is correct. 

Description : Which of the following statements is false? (1) Every context-sensitive language is recursive. (2) The set of all languages that are not recursively enumerable is countable. (3) The family ... under union. (4) The families of recursively enumerable and recursive languages are closed under reversal.

Last Answer : The set of all languages that are not recursively enumerable is countable.

Description : Which of the following statements is true in the context of the testing of a hypothesis? (A) It is only the alternative hypothesis, that can be tested. (B) It is only the null hypothesis, ... the null hypotheses can be tested. (D) Both, the alternative and the null hypotheses cannot be tested.

Last Answer : (B) It is only the null hypothesis, that can be tested.

Description : Pointer holds A) Value of variable B) Address of variable C) Value and address of variable D) Always null

Last Answer : B) Address of variable

Description : The property of binary tree is A) The first subset is called left subtree B) The second subtree is called right subtree C) The root cannot contain NULL D) The right subtree can be empty

Last Answer : D) The right subtree can be empty

Description : The ..................... is essentially used to search for patterns in target string. A) Like Predicate B) Null Predicate C) In Predicate D) Out Predicate

Last Answer : A) Like Predicate

Description : Reflexivity property says that X Y is true if Y is …………………. A) Subset of X B) Null set of X C) Super set of Y D) Subset of Y

Last Answer : A) Subset of X

Description : …………….. is used to determine whether of a table contains duplicate rows. A) Unique predicate B) Like Predicate C) Null predicate D) In predicate

Last Answer : A) Unique predicate

Description : NULL is (A) the same as 0 for integer (B) the same as blank for character (C) the same as 0 for integer and blank for character (D) not a value

Last Answer : (D) not a value

Description : Which of the following is a legal expression in SQL? (A) SELECT NULL FROM EMPLOYEE; (B) SELECT NAME FROM EMPLOYEE; (C) SELECT NAME FROM EMPLOYEE WHERE SALARY = NULL; (D) None of the above

Last Answer : B) SELECT NAME FROM EMPLOYEE;

Description : Suppose that the time to do a null remote procedure call (RPC) (i.e, 0 data bytes) is 1.0 msec, with an additional 1.5 msec for every 1K of data. How long does it take to read 32 K from the file server as 32 1K RPCs? (A) 49 msec (B) 80 msec (C) 48 msec (D) 100 msec

Last Answer : (B) 80 msec

Description : In RDBMS, the constraint that no key attribute (column) may be NULL is referred to as: (A) Referential integrity (B) Multi-valued dependency (C) Entity Integrity (D) Functional dependency

Last Answer : (C) Entity Integrity

Description : In Unix, how do you check that two given strings a and b are equal ? (A) test $a -eq $b (B) test $a -equal $b (C) test $a=$b (D) Sh -C test $a==$b

Last Answer : (C) test $a=$b Answer: C Explanation: Tests for a zero-length string: test -z string Tests for a nonzero string length: test -n string Tests two strings for equality: ... Tests two strings for inequality: test string1 != string2 Tests for a nonzero string length: test string

Description : …………. Refer to the names of variables, functions, arrays, classes etc. created by the programmer. A) Keywords B) Identifiers C) Constraints D) Strings

Last Answer : B) Identifiers

Description : What arithmetic operators cannot be used with strings ? a) + b) * c) – d) All of the mentioned

Last Answer : c) –

Description : How many strings of 5 digits have the property that the sum of their digits is 7 ? (A) 66 (B) 330 (C) 495 (D) 99

Last Answer : (B) 330

Description : Which of the following are not regular? (A) Strings of even number of a's. (B) Strings of a's, whose length is a prime number. (C) Set of all palindromes made up of a's and b's. (D) Strings of a's whose length is a ... ) (A), (B) and (C) only (3) (B), (C) and (D) only (4) (B) and (D) only

Last Answer : (B), (C) and (D) only

Description : Which of the following strings would match the regular expression: p+[3-5]*[xyz]? I. p443y Il. p6y III. 3xyz IV. p35z V. p353535x Vl. ppp5 (1) I, III and Vl only (2) IV, V and VI only (3) II, IV and V only (4) I, IV and V only

Last Answer : Answer: 4

Description : The statements s1 and s2 are given as: s1: Context sensitive languages are closed under intersection, concatenation, substitution and inverse homomorphism. s2: Context free languages are closed under complementation, ... is not correct and s2 is correct. (D) Both s1 and s2 are not correct.

Last Answer : (B) s1 is correct and s2 is not correct.

Description : Which of the following sets represent five stages defined by Capability Maturity Model (CMM) in increasing order of maturity? (A) Initial, Defined, Repeatable, Managed, Optimized. (B) Initial, ... Initial, Defined, Managed, Repeatable, Optimized. (D) Initial, Repeatable, Managed, Defined, Optimized.

Last Answer : (B) Initial, Repeatable, Defined, Managed, Optimized.

Description : High level knowledge which relates to the use of sentences in different contexts and how the context affect the meaning of the sentences? (A) Morphological (B) Syntactic (C) Semantic (D) Pragmatic

Last Answer : (D) Pragmatic

Description : Consider three CPU intensive processes P1, P2, P3 which require 20, 10 and 30 units of time, arrive at times 1, 3 and 7 respectively. Suppose operating system is implementing Shortest Remaining Time first (preemptive scheduling) ... end of Ready queue are not counted). (A) 3 (B) 2 (C) 4 (D) 5

Last Answer : (A) 3

Description : Which of the following statement(s) is/are correct with reference to curve generation? I. Hermite curves are generated using the concepts of interpolation. II. Bezier curves are generated using the concepts of approximation. III. The ... (B) II and III only (C) I and II only (D) I, II and III only

Last Answer : (D) I, II and III only

Description : Chomsky’s linguistic computational theory generated a model for syntactic analysis through __________ A. Regular Grammar B. Regular Expression C. Regular Word D. None of these

Last Answer : A. Regular Grammar

Description : Consider a system with twelve magnetic tape drives and three processes P1, P2 and P3. Process P1 requires maximum ten tape drives, process P2 may need as many as four tape drives and P3 may need upto nine ... , system is in: (A) safe state (B) unsafe state (C) deadlocked state (D) starvation state

Last Answer : Answer: B