0% found this document useful (0 votes)
88 views14 pages

3rd Mid Sem Pyqs

It is about the university exam in cse branch 3rd semester btech nit jamshedpur

Uploaded by

gkumar1135gk
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)
88 views14 pages

3rd Mid Sem Pyqs

It is about the university exam in cse branch 3rd semester btech nit jamshedpur

Uploaded by

gkumar1135gk
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/ 14
NATIONAL INSTITUTE OF TECHNOLOGY, JAMSHEDPUR MID-SEMESTER EXAMINATION November - 2022 CLASS: B.Tech (Honours) ~ Ill Semester SESSION: 2022-2023 BRANCH: CS, MM. FULL MARKS: 30 TIME: 2 Hours COURSE CODE: HS1301 ‘SUBJECT: Introduction to Soft Skills, ‘Name of the Teachers: Dr. Rajiv Bhushan, Dr. Doreswamy INSTRUCTIONS: 1) Allquestions are compulsory. 2) All questions are of equal value. Candidates have to answer all parts of a Particular question at one place only. 3) The figures in the right hand margin indicate full marks. 1. What is "Time Management?" Describe, in detail, how you can manage your time (10) effectively to achieve success. 2, Write an application in response to an advertisement for the post of a Management Trainee (Technical) at Steel Authority of India Limited, Ranchi. Also attach a (10) chronological resume of yourself. 3. Assuming yourself to be the General Secretary, draft the minutes of a meeting of the Students’ Council of your institute, convened to discuss the events to be organized for” QJASS 23" . (10) Department we eeort orTeTege TECHNOLOGY JAMSHEDPUR under MHRO, Government Of Indio) NATIONAL INSTITUTE ©! tant {An Institution of National Irn Department of Computer Science and Engineering Autumn 2022-23 Mid Semester Examination, B, Tech, (2nd Year): 3rd Semester Course Code: CS1301 ‘ Date of Exam: 12/11/2022 Course Name: Digital System Design ‘Time: 2 Hours Max Marks: 30. Name of Faculty: Dr. Vinay Kumar Note: Assume any relevant missing data, if any. Question 1: a) Implement a Full Adder circuit with & multiplexer. bb) Construct a 5X32 decoder with 3X8 and 2X4 decoder(s). Show block diagram as well as cireuit diagram for the same. [5+5] Question 2: Simplify the K mapping 2) F(AB,C,D)=Sm2.4,5,13, 14) + Fd(0,1,8,10) b) F (A, B, C, D) = TIM(0,3,4,5, 7) ©) Prove that AB+AC + ABC(AB + 6) = 1 [3+4+3] Question 3: 4) Using Boolean identities, reduce the given Boolean expression: F(X, Y,Z)=X/V+YZ'+ YZ+XY'Z! b) What is the combinational circuit? Explain with a diagram. ©) Explain a carry look-ahead (CLA) adder. Draw the logic circuit diagram of CLA adder. 48), What are the advantages of digital signal over an analog signal. [2424541] Department of Comm Department of Computer Science & Engineering, National Institute of Technology, Jamshedpur Mid-Semester Exam, 10" Noy 2022, Thu Class: B. Tech, CSE, "Semester Course Title and Code; Design and Analysis of Algorithms CS1302 2 Full Marks: 30 ; is Time: 2 Hours Name of the Instructor: Rajiv R. Suman Answer any SIX questions. Make suitable assumptions wherever essentially required, and mention them clearly, T. Use the following set of opesauons to illustrate the implementation of a FIFO queue using two stacks S; and Ss. Show the contents of both stacks after every operation. Write the time complexity of insertion and deletion whes there are total items in the queue. (a) Insert items 10, 25, 45, 20 into the queue (i.e, into the pair of stacks S; and S;). (b) Delete two oldest items from the queue in FIFO order. (©) Insert 23 and 46 in the queue. (@ Delete one oldest item from the queue. (©) Insert items 15, 25 and 10. (Delete three oldest items in FIFO order from the queue. e 2. Use method of induction to show that (a) The maximar number of nodes on level & in a binary tree 2", k> 1. (b) The maximum: number of nodes in a binary tree of depth kis 2-1, k> 1. Do not show by taking example binary tree as examples do not make an acceptable proof. s 25+25= 3. An array of integer cobtains n integers. (@) Write an efficient algorithm (with minimum time and space complexities) to move all the even numbers at the Seginning of the array and odd numbers after the all the even numbers in che array, ic, if input array is A[I2, 9, 42, 14, 15, 100, 33, 10), then it is converted to A[12, 42, 14, 100, 10, 9, 15, 33]. Note that the original order of even elements should not change, that is, even elements are in sequence 12, 42, 14, 100, 10 {n input as well as in output list. Same should hold for the odd elements too. DO NOT use additional array. What is the time complexity of your algorithm in the best case and worse case? (©) Can the time complexity be reduced (if yes, show how) i. by using additional array as temporary storage? ji, ifitis allowed to change the original order of even and odd elements? B+I+1=5] 4. For a binary tree, let us assume that ny = total number of leaf nodes, ni= number of nodes having one child, nz = number of nodes with two children, (2) Write an efficient algorithm to dstermine the values of n,m; and np, (0) Show that ny mz +1. Give logica’ proof. \ (342 =5] 5. Write an algorithm to determine the height of a binary tree when pointer to its root node is siven as input. Height of a binary tree is defined as tie maximum level of any node in the tree where level ofthe root node is assumed te be 1 and level of any other node = level of ite parent node + 1. ‘What is an AVL tree—Why is its name AVL? Insert the following values in an AVL tree a show the required rotation at each step. 12, 16, 20, 32, 5, 7, 8,9, 18, 19, 34, 21, 25, 35, 31, 34 5] @.T.0) (a) Given are the in-order node sequence B, H, G, D, F, C, E, A, I, L, N, M, 0, 1s K,J,.Q,P and the pre-order node sequence A, B, C, D, G, H, F, E, 1, J, K, L, M,N, 0, P,Q ofa binary tree, Draw the tree graphically showing some intermediate trees, (b) Write an algorithm to find the suecessor node of any given node in a binary search tree, (25+25=5) 8. Mlustrate the working steps of heap sort or quick sort to sort the following sequence of number in nondecreasing order. 12, 16, 21, 32, 5, 7, 8, 9, 18, 19, 34, 21, 25, 8, 31, 34 9. (3 Write an algorithm to sort the nodes of a linked list in nonincreasing order of keys in the node using insertion sort. 6 Input List = {5} tH i h tree T. Write pseudo code of an algorithm to delete a node from a binary searc © ® Extend the algorithm of part (a) to defete a node from a balanced binary search tree T (aka AVL tree), ‘Assume that an algorithm Suee(k) is given that returns the inorder successor node of node fin the binary search tree T. ¥ Bence No. of Pages: 1 Roll No, National Institute of ‘Technology, Jamshedpur ‘Third Semester (Mid Sem) Examination November, 2022 Branch: B.Tech (2nd Year-2021 Bateh) pa ee Subject: Diserete Structures ee ge Subject Code: CS1303 Answer all questions. The figures on the right hand margin indicate marks, Take N= ast two digits of your roll number’ in all questions if required. 1. (a) Use mathematical induction to prove that forall integers n > 1, ee 1 La Jt og tot Fg > FT) (8) Sv the recurrence elaton by = ya + (2 positive integer k and initial eondition by = 0: )?=6(8) +8 whan 2. (a) How many reflexive and antisymmetric relation are there in a set of n elements (ex- planations required). Find the transitive closure of the below relation on the set A= {ayb,e,dse} a8 B= {(0,8)s(@5), (05€)s (0,0), (Bye) (eA) (€s8)s (dha), (6,2))- (6) Consider the set $ = 2, and relation is defined on $ as R= ((c,y)| when 2{(2 + 9)} Justify whether R ia an equivalence relation or not, Find the equivalent classes (2, {ln and [12}n. 3. (a) Let (51,4) and (S, 2) are two posets where Si = {1,2,4,6) and $2 = (1,2,3,6) ‘and both the partial order relation are divisbility relation. With respect to the lexi- cogephical order on St x Sp, find all such pairs (z,y) such that (2,3) ~ (4,2)- What changes will be there if we choose the product ordering? der the poset (Soo, ~) where set Sin = {1,2,3,4,5,6,10,12,15,20,30, 60} and the partial order relation +" defined as the division relation on Sgo. Draw the Hasse diagram of the poset. What are the upper bounds and the Least upper bound for subset A= (4,53 15}. A eeeeeeensers All the Bost ter eeeerr errs 6) (243) 6) (+2) 8. Sungest a gree HEBEL preedy solution to the Job sequencing wth dealin problem a) 9. Give an example Give an example deted graph with 6 vies and ot moe ees in which he Relinan-Ford port may Fin sas pat oa given sours ven tal lr vertices of ‘in OC) time only in the best case. (© nove) in inte wort ese. Explain how the shorts path s computed inthe above mentioned cases. - Q+2=4) o ae a algorithm to find all the strongly connected components ina directed graph yh eth fa (ote folowing gah showing he npr ers a . a (243 =5) 3. What us of pli sort of dst rs? Cantal he gah ofan rexson a 12. (@ Outline an algorithm to find t i 1 to find topological ordering of directed raph (©) Apply the algorithm of part (at the following graph showing the important tps. bH=5] 13, Solve the following instance of the 0/1 knapsack problem wsing the backtacgng method showing the state space tre generated. Knapsack capacity W ~40, number of tems “BHO and item rot pis are (1, 21), (6,25) (To31) 5,200, 30) (10, 25) (2s Dy 10), (11 65 (12 50 m 14 Weta polynomial tine vtfation algorithm fo the vertex cover problem B) 1S, Wit a non-deteminti aloritim forthe clique decision problem Bl 16, Show the relationship among P, NP, co-NP, NP-hard, and NP-complete problems. a 17, Show that overlapping subproblems exist in (@) Matix chain multiplication problem (@) Longest common subsequence problem (©) Shortest path problem Bx3=6) 18: Qo tata te problems in question 17 have optialsubsrctre properties, [1x3=3] 19, Compute transitive closure ofthe graph of question 10. a 420,. Write recursive formulas (equations) for dynamic programming solutions of (a). Mari chain multiplication problesa {() Longest common subsequence problem {©) Shortest path problem (@) 0/1 knapsack problem [x44] 21, Wete control abstraction (generic algorithm) for Backracking method. a ooaca pe mpl conditions, exit conditions and state space tet ole either te sum of 26 Ginsu problen or the raph coloring problem using the bakracking method. 8) --ENI Student Roll No - National Institute of Technology, Jamshedpur |-Sem) Examination - Oct 2023 Max. Marks: 30 “Time: 2 Hours Third Semester ( Branch: B.Tech (Year) ‘Course lnstruct 1 All questions are compulsory. ll the subparts of aquestin are to be attemped gether, Marks Q1 8) Writethe name of any four feds in an activation reeord, a 1) Whatis the time complexity of the following function? uy p= 0; for = ip <= mit4){ p= pte) ©) Whatare the conditions for FULL CIRCULAR QUEUE and EMPTY CIRCULAR QUEUE? a a) The dynamic-set operation UNION takes two disjoint sets 5, and S2 as input, and it returns @ iy st $ = S, US, consisting of ll the elements ofS, and S,, Show how to support UNION in ‘O(A)time using a suitable ist data structure, ©) Whatis the minimum number of comparisons (in asymptotic notation) required to determine if [1] an integer appears more than n/2 times ina sorted array ofr integers? Justify your answer. 1) Consider the following recursive C+ function that takes two arguments a unsigned int foo(unsigned int n, unsigned intr) { if (n> O) return (nSbr + foo (n/t ): else return 0;)} ‘Whats the return val ofthe Function foo when iis called as fo0(345, 20)? Q2 3) Wei the procedure for implementing QUEUE wing two STACKS. Anayzetheruningtime 2] ofthe queue operations +) Show how fo implement a slack using two queues. Analyze the running die ofthe sack [2] operations. ea ‘@)_ What does the below funeton do in general? void fun(Queue * Q) { ‘Stack $; // Say it creates an empty stack S 7/ Ran while Q is not empty while (ismpty(Q)) // deQuowe an item from Qand push the dequewed item to S push(&5, deQuewe(Q): 7 jan whe Stack Sis not empty while !1sEmpty(&5)) [pop an tom from $ and enqueue the popped item to Q enQuewe(0,poPC85)): B i|Page o 9 » 9 » sseavsvsesceseeneneenenee04End of Ques: on Paper *##8440 fora 4g any ASO be as = 10, 2 Pind hades of A213] Wn tne ing ro-naioredet {Fd he address of 421] wen stored wing clu-naor os Assam hat nh ier king p 8 yes of soage MEMO. Give a 0(r).ime non ecusive procedure thst reversing Hinks of eens The poet bold weno moe han onan stage beyond tt edd forth it. er. What woul be the worst xe tne Tevingame sign aogier all oR Consider an array consisting of -ve and 4ve mt complexity ofan algorithm to sogregate the numbers fneside and then all-ve onthe tier? CConside the below program, and what i doing this program basicaly? include using nemespace sti void prine(char ain mint ind) ( for int = ind 4 < m+ ind: (44) 5 ome SMe q ne main t char af} = ('A1B''C2'D EE inen = sizeof(a) /sizeof(al0): print(a,n.3): Peeurn 0} Josephs problem; & group of sles are sirotied by an ov ips of victory without reinforcements. Thee i oly singe oes agpe toa pact fo determine which of them sto escape ‘owl, anda number n and ope of thet ames ate picked fo 2fes wtse ame is picked, they begin to coun levis around the ice, When the count SANS tat slder is removed fom the crcl, pd the count Dezis again withthe next ra Fhe elinnated soldier sno longer apart he ice. The process continues til one sald rmain, an takes the brs to suanon lp. Suppose n=3 and thereat ive sodiers sae ins a ceein the following order A, B,C, Dand E Let the soldicr start with be A, Ire iScinioated fst then Ages eliinated secon, then Et thi, finally B ges eininated. Sob isthe one who escapes withthe hors, Writea funtion in C which displays the names of Seca toldier nthe eed of thi elimination and fly the name ofthe soldier lef, using ‘teu Tnked ist New ist should nl be erated, The declaration of the faction ‘old Jasephus (NODE » head, char name, i) rwheiming army. ere i520 ore available for escape. TPE ad summon be. Tey form) hat Beginning with the 'A pobmomia is sum of terms, where cach erm hs afar ax, where xis a varible, a is the coutiient, nde isthe exponent (eg ACG) = 347° 2x +10 “Answer the following questions in context of panomial: + Define the Abstract datatype (ADT) for pobomia. 2 Wie the funtion pada for adding two polynomials. Figure ou the computing ime of your function. 4+ Wite the funetion pamulté fi (io) c © Ql a) ») 9 4) Q2 a) b) % Student Roll No. iamch: CSE @2* Year) Max. Marks: 30 ‘ourse Name: Data Structure “Time: 2 Hours ‘ourse Cade: CS1304 Dr. Dinesh Kuma structions (Related to Questions) 4. emp all questions. 2. Question J comin: four sub-question of 3. Question 2 contains five snbgiestcns of to-marhs cach 4. Question 3 contains four sub-queions of four-marks each Marks iW amar ach What isthe average numberof comparisous needed to seach a sorted singly linked Hist of Feng fora siven element? What isthe time complenty of finding an clement from au Array of m elements, which is neither [1] ‘What are the time complexities of finding 8° element from begining and 8° element fom end in 81) singly linked fist? Let n be the numberof noes in linked list, you may assume that > {A program p reads in $00 integers in the ange (0,100) representing the seores of $00 students. If here 11] is noe to print the frequency ofeach seae above S0, then what isthe minimum size ofan arroyo store the fequencies? What sth output ofthe ftlowing program’? Ri include int main) ( ine arr] = (1,2.3.4,5,6)5 17 Assume base adress of as 2000, ze of neers 32 bit and menor printf Cu \w arr + 1): printf Cu \n" Barr + 1 line oper = (ont )(Barr + 1}: printf Cd \w" 2 ptr — 1) (rr + 5) += 10: printf ("6d \n' arr return; ) Let Aft...n] bean aray ofm distinct numbers. < j and Afi] > Alf]. then the pair (i,j) is called {2} in inversion of A. Wha isthe expected numberof inversions in any permutation on elements? PI Leta be array containing m integers in inereasing order. The following algorithm determines whether there are two distinct numbers inthe array whose difference isa specified numbers 5 > 0. Complete the rogram by filling Blank inthe "if" statement ie. ine no 3. % below i A 4 5 while 45506 oid fun(struct nade + start) ( (stare veer) prints Ma "stare-> data), Iy(start—> next! = NULL) (un start—> next> next);) prin Cd %stare—> data uu ) ‘Consider a singly linkod list whore and L are pointes to the first and last elements respectively of the [2] linked list, Coe + Whats ihe ce complex of deleting te lst clment fom the inked Tis? Justis your «What s the time complexity of adding the element inthe last ofthe above inked list? Justify ut Answer the following sub-questions inthe context of Datatypes and Abstract Datatypes i. Whats the definition of «datatype ii, In edition tothe four arithmetic operations, what are some ather operations that are typically detned for the integer data type? Why are ADT abseact? |What 1 elements are required for an ADT? 2D arrays withthe [4] oy to dynamically allocate a 2D aay in? Discuss Following conditions: Using the stack memory enly Using both the stack and heap memory Using Heap memory only Discuss each ofthe above case with an ilusuative exunple How a 3D Array is epresented in memory by the eonpiler? Explain the row-najor and column major [4], onfets 0 representa 3D array and write down the equivalent formula Consider a three dimensional array A(20|(10)30}. Assume 4 vores per memory eel, the base address ‘of aera A is 1000, first element is A0}[0]0). ‘Caleulate the address of A[LO][SI[1S]ifclements are sored in ow-major order. ‘© Caleulate the address of A(SI[8JJ0] if elements are stored io column-major onder. Given two sorted linked lists having Mand AV nodes respectively, write the program for merging these ‘so linked lists into a single sorted linked list without creating any extra list. Also mention the time complexity ofthe merging process. Yront ways of defini 4 NATIONAL INSTITUTE OF TECHNOLOGY, JAMSHEDPUR: MID SEMESTER EXAMINATION (OCTOBER -2023) SEMESTER: 3rd BATCH : 2022 BRANCI ‘SE FULL MARK‘ TIME: 2hrs. CREDIT: COURSE INSTRUCTOR: Prof. TARNI MANDAL, COURSE CODE: MA1301 Subject: Probability and Statistics INSTRUCTION: 1) Attempt all the questions . 2) Marks ofthe question and part their off are indicated inthe right hand margin. 3) Missing data, if any, may be assumed suitably. 4) Before attempting the question paper be sue that you have got the correct question paper SLNo. mi 1. (@) There are three ums having the following composition of black and white balls i Um 1. 7 white, 3 black balls ‘Um 2. 4 white, black balls Um3, 2 white, 8 black balls One of these um is chosen at randoin with probabilities 0.20, 0.60 and 0.20 respectively. From the chosen um two balls are drawn at random without replacement, Calculate the Probabilities that both these balls are white. - xonp, (b) fx isa Binomial variate with mean np and variance npq , show that isa variable [4] u m veg ‘with mean zero and variance unity, Find the M.G.F-for this variable ‘and show that it approaches €7 as n+». 2(a) To show that Poisson distribution isthe limiting case of Binomial distribution. way Find the Mean and Variance of Poisson distribution by Moment generating function. (b) To prove that Recurrence relation for the Moments of the Poisson 1 ie FFind the mean and variance, Distribution is Heya = TABraa +2 3 (@) xf and xf are independent Chi-square variate with ny and m2 degree of freedom 151 respectively, then U= xi+ x3, V = 7% are independently distributed, show that U is a Chissquare variate with parameter (nr+ ma) df. and V isa BiG? /52) df (©) Find the rank correlation coefficient to the following data: Br 5 A [sso Las Tos [4s [30 [70] 5, (a) To show that the moments of normal distribution about mean is t2a= 07 2n -1) H2n.2 4. (6) Out of 8,000 graduates in a town 800 are females , out of 1,600 graduate employees Be 120 are female. Use! to determine if any distinction is made in appointment on the basis of sex. value of zat 3% Level for one degree of freedom is 3.84 --000000000~ National Institute of Technology Jamshedpur Department of Math tics Mid-Semester Examination, Autumn 2023-2024 Branch: CSE 3" Semester Course: ©1303: Discrete Mathematics Date of Exam: October 20, 2023 Pull Marks: 30 ‘Time: 2 Hours Course Instructor: Dr. Subba Sarkar Instructions: This question paper consists of 6 questions. All questions are compulsory. Marks for the individual questions are indicated at the right-hand margin. + (a) For two infinite set A and B, what do you mean by ‘A and B have the same cardinality’? (b) State Schrdder-Bernstein Theorem, (©) Using Schréder-Bernstein Theorem or otherwise, prove that, |(0,1)} = [[0, - (a) Define countably infinite set (b) Show that Nx N is a countably infinite set. - (a) A relation R on a set A is said to be arreffenive if for all a € A, (a,a) ¢ R. A relation R is called asymmetric if (a,b) € R implies that (b,a) ¢ R. . How many relations are there on a set with n elements that are (i) irrefexive? (Gi) reflexive and symmetric? (iil) neither reflexive nor irreflexive? Give proper justification (b) Construct a relation on the set {a,b,¢,d} that is (i) reflexive, transitive, neither symmetric nor antisymmetric. (i) neither reflexive, nor irreflexive, nor symmetric, nor asymmetric, nor transitive Justify your answer 32) (a) Draw Hasse diagram of the lattice (Dza, |) of all positive divisors of 24. (b) Find complements of each element . (c) Find a sublattice of Dzy that contains at least § elements, THB 5. Let Q be the set of rational numbers and define a +b = a+b —ab, for all a,b € Q. (a) Is (Q,+) @ monoid? Justify your answer. (b) If (Q,*) is a monoid, which elements of Q have an inverse? 6. Let i = V=T. Prove that $ = (1,—1,4,-é} with complex number multiplication is a group. Is this group cyclic? Justify your answer. o

You might also like