0% found this document useful (0 votes)
3 views18 pages

all questions papers

The document outlines examination details for various courses at Jawaharlal Nehru Technological University Hyderabad, including Automata Theory, Compiler Design, and Formal Languages. Each examination consists of a compulsory Part A and a Part B where students must answer questions from different units. The document includes various questions related to automata, grammars, and compiler design principles.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
3 views18 pages

all questions papers

The document outlines examination details for various courses at Jawaharlal Nehru Technological University Hyderabad, including Automata Theory, Compiler Design, and Formal Languages. Each examination consists of a compulsory Part A and a Part B where students must answer questions from different units. The document includes various questions related to automata, grammars, and compiler design principles.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 18
Code No: 154CT. JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD R18 B. Tech II Year II Semester Examinations, September/October ~ 2023 AUTOMATA THEORY AND COMPILER DESIGN) I Infelligence and Data)Seience) i ‘Max. Marks: 75 2A CA Time: 3 Hours’ Note: i) Question paper consists of Part A, Part B. La) b) °) d °) p 8) h) i Dd 2a) b) i) Part A is compulsory, which carries 25 marks. In Part A, answer all questions. iii) In Part B, Answer any one question from each unit. Each question carries 10 marks cand may have 4;-,as sub questions, \-PART-A (25 Marks) What is meant by Deterministic FA and Non-Deterministic FA? 2) Draw the Finite automata that recognizes the regular expression: (I+10+110)*0. [3] Write down the statement of the pumping lemma for regular languages, Gonvertithe regular.expréssion (140)*101}to NFA. /j\ Give the formal detnition of Pushdown-automata. \ Explain about the graphical notation of PDA. Define the term syntax analysis. What is the role of the lexical analyzer? Define L-attributed and S-attributed definitions. What is syntax tree? Explain with an example. ony (50 Marks) Design a DFA to accept the set of all strings beginning with a 1 that, when interpreted as a [5+5] binary integer, is a multiple of 5. Convert the following NFA to DFA. - Cy 3.a) b) 4.a) b) 10.a) b) Draw the transition diagram and transition table for the DFA accepting all strings with a substring 01. Convert the following NFA with & [4+6] 5 > 4 lle 2 es to DFA without & moves: a b C2 ¢ Convert the following regular expression to NFA’s with E-transitions: 00(0+1)*- ryegular expressions to automata > [446], 0 é ? sonverti ith at most ion for thé Tanguage: The séf of strings of 0°S and 1's wit Write the regular éxpi one pair of consecutive 1's. Give the CGF generating the following sets: i) the set of all palindromes over {a,b} ii) the set of all balanced parenthesis. [2+8] Gondteuét the PDS th following gtamtnar: ~SaAA, ~~ ‘Aa | bS fa” fon - 7 Explain the acceptance of PDA with an empty stack. [6+4] RR ol Deseribe a Turing Machine by the 7-tuple and define the meaning of its components. [5+5] Construct a TM which multiplies two unary numbers. Design the LEX program that recofinizesthe tokens oPa GilanguageGGndl returns the token _/ LOWs. found: Od C Oe OL, Remove the left recursion for the following grammar and find FIRSTs and FOL : (5+5] ESE+T|T TOT*F|F F= @©)fid OR pute LR(0) items forthe following grammar and gonstruct SLReparser.table: [1Q]> /S>ERIRS ZL eR id Bt Of. t ee C Construct the syntax directed definition to convert infix notation into postfix notation. Translate the arithmetic expression a * - (b+c) into various intermediate code forms. [(5+5] OR leap, management, strategies in detail wa, Ce Ne (0, Explain the stack allgcation and H a C2 A re CSL OL Wet Oe -—00000--- R13 Code No: 1144G JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B. Tech I Year II Semester Examinations, February -2024 FORMAL LANGUAGES AND AUTOMATA TH (Computer Science and Engineering) Max. Marks: 75 ion paper consists of Part A, Part B. ii) Part A is compulsory, which carries 25 marks. In Part A, answer all questions, iii) In Part B, Answer any one question from each unit. Each question carries 10 marks and may have a, bas sub questions. PART-A (25 Marks) la) How to check acceptance of string by finite automata? (2) b) What are the differences between DFA & NFA? BI ©) Write the regular expression for the L={w €{0,1}* | w has no pair of consecutive zeros. Q] d) Whats content free language? Give example. BI e) Remove Null production from the following grammar S— ASA |aB|b A=B Bobije 2 f) What are the components of a Push Down Automata? BI 2) When do you say that a Turing Machine accepts a string? Q h) What is Turing machine halting problem? GI i) — Write about Universal TM. Ql i) Give example problems of type NP-Complete. BI PART-B (30 Marks) 2.a) What is Automata?-Explain classification of Automata, b) Design a DFA forlanguage every 00 is immediately followed by 1 over {0, 1}*. [545] - OR 3.a) Construct DFA for the given NFA. a0 2 a3 b) 4.a) b) 5a) =) 6a) b) machine corresponding to Moore machine. Texts | onan iQ ye=0 | 1P= gi g2 c qi CE G 3 3 rl 4 st a [545] Construct an equivalent FA for the giyen.regular expression (0+1)*(00+11)(O#1)* ; Explain the Pumping Lémma for regulat sets. Show that L={a"| pis a prime}is not regular. [545] OR Construct the regular grammar for the following FA, ‘ ot Explain about derivatigh and parse trees? Construct the sfring 11001010 from the Leftmost and Rightmost derivation. S>IB/0A ADI/IS(OAA B>0/0S/IBB. [545] Simplify the following context free grammar. (Here; A stands for epsilon (<)). ssTuly TaTbjA UDcU)A V>aVelW WbW] A. Convert the following grammar into Greibach normal form. SPAA/a ASSSIb. : [545] OR R18 Code No: 156AH JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD II Semester Examinations, March - 202: B. Tech III Year y oe COMPILER DESIGN’ > / / ° (6 6 ‘SE(DS) by / ©*s {Common té CSE, ECM, CSE(DS)) ~ Max! Marks: 75 Time: 3 Hours’ Note: i) Question paper consists of Part A, Part B. H Part A is compulsory, which carries 25 marks. In Part A, Answer all questions. iii) In Part B, Answer any one question from each unit. Each question carries 10 marks and may have ayb,as sub questions, ad PART=A Nn? dot ‘ (25 Marks) 1.a) What do you understand by backtracking? 2 How does the lexical analyzer handle whitespace and comments in source code? [3] b) ©) How can parser. generators help. in automating the generation. of parsers for programming languages? b A Ry d) What are the advantages and disadvantages of top-down‘parsing? BI : ¢) How are switch statements represented in intermediate code? il f) What are the different evaluation orders for Syntax-Directed Definitions? Bl 2] g) Define basic blocks and flow graphs. How does the run-time environment provide access to nonlocal data on the stack? [3] What do you understand by partial-redundancy elimination? (2) Lisbthe applications of data-flow analysis in compiler optimization. (>) t PART-B (50 Marks) 2.a) Suppose a source program contains the assignment statement position = initial + rate * 60 Show the translation of this assignment statement in each phase of the compiler. b) Draw the transition diagrams for unsigned numbers-arid whitespace. °° ~ OR™ - 3.a) Write a Lex program that copies a file, replacing each non-empty sequence of white space with a single blank. b) Suppose we have two tokens, the keyword if and identifiers, which i 0 , , are strings of letters other than if. Show (i) the NFA for these tokens and (ii) the DFA for these tokens, [5+5] (shsy, f 4.2) What linguage is-ginerated by the following griminars? In each ease justify your answer. / : @S+0S1/01()S4+SS|-Ssja ) — Construct recursive-descent parsers for the followi Rach rah wing grammar, [5+5] OR 6.a) b) 7.a) b) 8.a) b) 9.0) b) 10.) b) Show that the following grammar is LL(1) but not SLR(1). S—AaAb|BbBa Ase Boe [10] Construct a syntax-directed transiatioh scheme to translate postfix arithmetic expressions into equivalent prefix arithmetic expressions. Give an SDD to differentiate expressions such as x * (3 * x + x * x) involving the operators + and *, the variable x, and constants. Assume that no simplification occurs, so that, for example, 3 * x will be translated into 3 * 1 +0 * x. [5+5] OR c Shs How to transform’ 4 three-addressCode sequence ito one in whieh ‘each defir ined variabléigets a unique ‘Vatiable name:’ ~~ Write the unification algorithm of type checking. [5+5] Explain the static and dynamic storage allocation. Write Cheney’s copying collector algorithm in the context of trace-based collection. Bel, Discuss the desigh goals for garbage dollectors. Generate code for the following three-address sequence assuming that p and q are in memory locations. ; je-motion problem. Show that every depth-first presentation for every nonreducible flow graph has a retreating edge that is not a back edge. [5+5] OR Explain the following terms with suitable ae (a) Copy motion (b) Induction Bt \ 1d | UNIVERSITY HYDERABAD 1 Semester Examil is. Mareh = 2024 "AND AUTOMATA THEORY SEEM, FEE, CSECESD) Max. Marks: 75 Code No: 155BK JAWAHARLAL NEHRU Teel TL Year FORMAL LANGU, (Common to CSE. HNOLOGICA| ‘Time: 3 Hours Note: i) Question paper consists of Part A. Part I i) Part A is compulsory. which earries 25 marks. In Anewer any one question from each unit F bas sub questions, art A, Answer all questions. ‘ach question carries 10 marks iii) In Part B. and may have PART-A (25 Marks) La) 1 b) .s between DFA and NFA? BI ¢) List out the applications of Regular expression. (2) What are the Closure properties of Regular languages with examples? Bl e) Define Push Down Automata. (2) ) What is ambiguous grammar with an example? BI 2) Specify the inating useless symbols. How to identify them? Qi fh) State the Statement of pumping lemma for Context-Free Languages BI i) When do you say that a Turing Machine accepts a string? 1 3) Give an Example of a Recursive enumerable language. B) PART-B (30 Marks) 2a) Design e DFA that accepts any string with aababh as a substring over 5 = fa. b} b) Convert the following NFA to DFA (figure 1), (5+5] Figure | OR 3.a) Convertithe following NFA with e moves to DFA without & moves (figure 2) Si Figure 2 b) Convert'the following Mealy machine int its equivalent Moore machine. | {5+5] da) b) Sa) b) 6.a) b) 7a) b) TP=0 SCS Nex Sine | OP Next Sere] OP ES aan D B a 3B a T D oT eG B 1 S r D D 1 ic o What is regular expression? Write the regular expression for the following languages over Y=(0.1}* i) The Set of all stritigs stich that nuniber of O's is odd }) The set of all stéings that contain exactly three 1s The set of all strings that do not contain 1101 Explain about Arden’s theorem, for constructing t! (figure 3). dhe RE from a PA with an example (5+5] State and prove pumping lemma for regular languages. Write the process to)identify the eqilivalence of two BA’s? Find whether the two afe equivalent or not (figure 4(a) and 4(b)). Cy ry vf Jase 4 FA’S (545) >) Cae Figure 4(a) Figure 4() Explain about derivation and parse trees? Construct the string 11001010 from the Lefimost and Rightmost derivation SOIBOA ADLISOAA BDO 0S 1BB Explain about the applications of Context-Free Grammars: [545] OR Construct a PDA which accepts language of word over alphabet {a,b,c } contain {albleij.k €N.i+k=i Construct the PDA. that accepts the language generated by given grammar. (5+5] SSaABBiaAA. ASaBBlt, BSbBBIA 8.a) b) 9.a) b) 10.a) b) 11a) b) simplify the Following context free grammar. s+ TSeTbe USE youve WoEw & Convert the following grammar into CNF: {5+5) SPbA aB APbAA aS & BoaBB bS + oR; Explain’about the Closure propertivsof CFL's. erent. 55) eer sruct a Turing machine that recognizes the languag ounded Automata? Discuss the advantages of Why a Turing machine is called Linear B Linear Bounded Automata. Explain the design of univer sal Turing machine with its halting problem. [5+5] and Undecidability Problems. Explain about the Deoidability dence problem p={(10,101), O11 A1GOL.O1D} has (545) Find whether post? correspon’ match? Give the solution. -—-00000--- L810 | vA WATAKLAL NE AL NEHRU TECHNOLOGI RABAD B.Tech Il Year 11 Semester DATABASE MANAGE! ebruary -2024 TEMS Time: 3 Hours Max. Marks: 75, aper consists of Part A, Part B. compulsory, wI pl ry, Which carries 25 marks. In Part A, answer all questions. iii) In Part BL Ai art B. Answer any one question from ea es Pees y question from each unit. Each question carries 10 marks ib questions. PART-A (25 Marks) 1a) Define logical data independence. (2) b) What is a view? GB) c) What is procedural DML? Q d) What is’an active database? BI ) What are spurious tuples? Q) f) What is transitive rule for functional dependency? GB) 2) Define serializable schedule. Q) h) What is the motivation for concurrent transactions? 8) i) — What is the use of cylinder on a disk? (2) 3) List the drawbacks of ISAM indexing technique. B) PART-B (30 Marks) 2. Explain the role of ER model in database design process with suitable examples. [10] OR 3. What is an integrity constraint? Explain enforcement of various integrity constraints in DBMS. {10} 4. With siiftable exainple expressions; illustrate various operators available in Relational Algebra. (0) OR 5. Consider the following database schema to write queries in SQL. Student(Rollno, name, totalCredits) Course(Cno, cname, credits) Enroll(Rollno, Cno,-Grade) a) Find students who stored grade‘A.in DBMS b) Find the students enrolled for DBMS and CO ) Find the courses having enrollment less than 50. 34344] What is redundancy? Explain the problems caused by redundancy. (10) OR Does third normal form ensure dependency preservation? Justify your answer with z Ps y pl y suitable examples. (10) Explain how time stamp based protocol ensures serializability of schedules. (10) ~ oR Demonstrate buffer fnariagement to’support recovery techniques. {10} Describe the significance of multi level indexing and its influence on tree based indexing. {10} OR . a Make a comparison of extendible hashing and linear hashing techniques as indexing structures. {10} ---00000--- JAWAHARLAL NE ‘Tech 11 Year IS Time: 3 Hours contains two parts A and B. ii) Part - B for 50 marks. J consists of ten sul Note: This qu i) Part- A for 10 marks, * Part-A is a-compuls units carrying equal marks ists of ten questions (numbered fr tions and the student s five questions from Part-B. b-questions from all om 2 to 11) carrying 10 marks howd answer one each, From of them. Henee, the student s (10 Marks) 1.a) What are Instance. variables in Java? a b) Mention the wo major types of type casting in | a) ¢) What is difference between interface and abstract class? ti] d) Cana class implement 2 interfaces in Java? ian e) What is Finally block? ul f) What does @Override annotation do in Java? W g) Whiatis.a Scrollparie? iy h) What is the need of Adapter class?, uw i) List one limitation of AWT. ran) 1? Give an example. Ww j) Can we pass parameters to an Java Apple’ PART-B Marks) 2.a) How dovyou declaré ‘and initialize-Single Dimensional-and 2-Dimensional arrays in Java? Explain. b) What is the main purpose of Garbage collection in Java? [733] OR 3.a) Write the syntaxes of While and For loops in java. b) Write a java program to find factorial of a given number using recursion? [446] 4.a) Write the benefits andlimitations of the Inheritance in Java, b) Explain Multi-level and Hybrid Inheritance in Java with suitable examples. [4+6] OR sia) What are the two types of Packages in Java? How package is created in Java? Explain with an example. b) What is the difference between compile-time polymorphism and runtime polymorphism? {6e4] 6.) b) Ta) b) 9.) b) 10.2) b) la) b) How do you create a Thread in Java? Explain Thread Priorities importance. What is Multi Threading? How do you implement it in Java? oR Explain the role of Try-and Catch blocks in handling exceptions. Give one example. Write the benefits of exception handling in Java. [6+4] (6+4] Explain Keyboard event handling in Java. (10) OR What is Delegation event model? Explain How the AWT labels are created in-Java? Explain with an example. [or4} How do you create an ‘Applet in Java? What are the'4 methods of applet class? Explain. Explain 2 types of Applets in detail. {5+5] OR What is the MVC architecture? Explain. Explain JFrame and Trees in Java Swing? [543] --00000—- DELALK IIL), CSE(DS), SD) TE, CSB, COLL, tL ‘ DS, AIKML; (Common to CS Max. Marks: 75 ists of Part A, Part B. tries 25 marks. In Part A, answer all questions on from each unit, Each question carries 10 marks iii) In Part BL Answer any one qu and may have a, bas sub questions PART-A (25 Marks) 1.a) Differentiate between physical schema and logical schema RI b) Define atomicity and consistency. B) ©) What do you mean by procedural DML? Ql d) Differentiate between SQL commands DROP TA! BLE and DROP VIEW. B) (21 ©) Demonstrate transitive dependency? Give an example £) Which normal form is considered adequate for normal relational database design? [3] 2) Give the reasons for allowing concurrency. Q] h) Design your own example to illustrate cascaded rollback, BI i) Define Primary index and Secondary Index. 2] Bl 3) Diseuss-about Densé Index. PART-B (50 Marks) Discuss the main characteristics of the database approach and how does it differ from 2.a) traditional file system. b) What are the three leyels,of abstraction in DBMS? Explain. [543] OR 3.a) List the different types Of database users with their roles. b) What is meant by E-R model? Explain with an example. [5+5] 4.a) Explain about different types of integrity constraints. b) Define Join. Explain different types of joins. (5451 OR 5.a) Write about views-and updates on views, Jgebra with an example. [545] b) __Iilustrate-different set Operations in- Relational al 6.) _ Explain Triggers in SQL and its types with an examples, tional dependency and Closure of Attribute sets. [5+5] b) Explain Closure of Set of Fun oR 7a) Explain Decomposition and its properties. b) Explain-Boyce-codd normal form with anexample. [545] 8.) b) 9.a) b) 10.a) b) l1.a) b) Explain about the two-phase locking with suitable example. Describe about testing of Serializability. OR Explain log-Based Recovery in detail. Describe Validation-based protocols. Write in detail about Hash based Indexing and Tree based Indexing. Describe the different types of file organization. Explain B+ trees. Discuss about this dynamic index structure. Illustrate insertion-and deletion of an clement in B+ trees with example. ---00000--- No: H4CX Je y, vi oo JAWAHARLAL NEHRU 1p i Tech H Yeny NOL cars, AL UNIVERSE R13 ions, RAMMING e: 3 Hours ommay ial Mmnon CSE rf Viny February aay) 88D Tit Max. Marke: 75 i) Question paper consists of | Part A ise ih tA is compulsory, which carrig 25 $25 marks. 1 in P iii) In Part B. Ans) . Answer any and may have 'Y one questioy y have a, b as sub aa et from each unit, Each qu carries 10 mark Not! ‘art A, answer all question PART- A, (25 Marks) 1a) Define polymorphism and inheritan ance, b) — How to cast types ii pes inc . 2 Neate me pen in g 2 What Ee the significance of CLASSPA a b fl < List out various checked exceptions in Java 3 f) ~ How to ereate threads in Javad ta 2) What is the use of Scanner class? BI (21 h) Contrast text stream: i hi ‘ x s and binary st i) List the swing containers. ee Fy i : What are the various events generated by menu, List box components? 6} ‘ PART-B (30 Marks) object oriented Compare and contrast procedure oriented programming 2. programming. Which paradigm is preferred for advanced problem solving? Why [0] OR What is method.overloading? Demonstrate with.sample Java code. (5+5] 3a) b)...Write a Java program-to check whether a given string is palindrome. 4, Write a program to explain the concept of dynamic method dispatch and also discuss real world applications of this concept. [10] OR ested class an inner class? Justify your answer, 5.a) _ What is a nested class? Is every n b) Explain the member access rules For package in Java 6.a) Explain the benefits ofexception handling. = b) Demonstrate creation of user defined exception in Java OR d thread priorities. ue Jement producer-consumer communication using inter ie 5 7.a) Describe thread states an b) Write a program to imp communication functions. TY HYDE ruary - 2024 ORY Code No: 134BD JAWAHARLAL ions, Feb rOMATA THE! IT) B. Si FORMAL LANGUAG (Common to C: Time: 3 Hours Max. Marks: 75 s of Part A, Part B. which carries 25 ma one question from each unil Note: i) Question paper consists Part A is compulsory, iii) In Part B, Answer any and may have a, b as sub questions. rks, In Part A, answer all questions. ‘. Each question carries 10 marks PART-A (25 Marks) 1a) _ Identify the elements of finite automata. Q] b) Design FA with Y = {0, 1} accepts even number of 0's and even number of I's. [3] c) Outline the operations of Regular Language. ) 4) How is the Pumping Lemma used to.prove that a language is not regular? B) e) _ Identify'the properties of parse tree. 2] f) Construct a CFG for the regular expression (0+1)* Bl 2) Discover the features of the Turing machine 2] uivalent CFG. BI rting PDA to an eq h) State one challenge involved in convert e problem concerni i) Identify one example of an undecidab| ing Turing Machines. [2] j) What is recursively enumerable language? Bl PART-B (50 Marks) 2.a) Compare the characteristics of NFAS with DFAS. b) Design a DPA L(M) = {w | we (0, 1)*} and W is a string that does not contain consecutive I's. [545] oR rams and transition tables in detail. ved in the*algorithm for eliminating e-transitions from a finite 3.a) Compare transition'diag +5] b) Describe the steps ‘invol automaton. 4.a) Write the regular expression for the language L over ¥ = (0, 1} such that all the string do not contain the substring ol. n is also defined by a finite b) Prove that every language defined by a regular expressio automata. , : [5+5] ‘ OR 5.a) Construct the FA for'régular expression OF + 10. b) Discuss real-world applications of Regular Expressions. [5+5] 6.a) _ Illustrate about derivations in the context of CFGs. b) Let, L (G)= fa" b"| m> O and n2 0}. Find out the grammar G which produces L(G). (5+5] OR 7.) b) 8.a) b) 9a) b) 10.a) b) 11a) b) Discuss Deterministic Push Derive the string "aabbabb CFG given by. S— aB|bA SS alaS|bAA § ba] aBB GE) m Automata. for leftmost derivation and rightmost derivation using a Explain the concept of Chomsky Normal Form for Context-Free Grammars with example. Construct TM for the addition function for the unary number system. {5+5) oO Analyze the running time complexity . of converting a context-free grammar to Chomsky Normal Form: Interpfat Turing Machine program with example. (5+5] Explain NP-complete of SAT problem. Explain Rice’s theorem and properties of RE Language {5+5] oO State the properties of recursively enumerable sets which are undecidable. Obtain,the solution for thie following systém of posts correspondence.problem. — [5+5] A= (100, 0, 1}, B=’(15-100, 00} ---00000---

You might also like