GATE-CS-2003Last Updated : 02 Dec, 2021ReadDiscussCourses GATE-CS-2003Please wait while the activity loads.If this activity does not load, try refreshing your browser. Also, this page requires javascript. Please visit using a browser with javascript enabled.If loading fails, click here to try againQuestion 1Consider the following C function. float f(float x, int y) { float p, s; int i; for (s=1, p=1, i=1; i < y; i ++) { p*= x/i; s+=p; } return s; } For large values of y, the return value of the function f best approximatesx^ye^xln(1 + x)x^xGATE-CS-2003 Discuss itQuestion 1-Explanation: See question 1 of http://www.geeksforgeeks.org/data-structures-and-algorithms-set-5/Question 2Assume the following C variable declaration int *A [10], B[10][10]; Of the following expressions I A[2] II A[2][3] III B[1] IV B[2][3] which will not give compile-time errors if used as left hand sides of assignment statements in a C program?I, II, and IV onlyII, III, and IV onlyII and IV onlyIV onlyGATE-CS-2003 Discuss itQuestion 2-Explanation: See http://geeksquiz.com/c-arrays-question-6/Question 3Let P(E) denote the probability of the event E. Given P(A) = 1, P(B) = 1/2, the values of P(A | B) and P(B | A) respectively are1/4, 1/21/2, 1/141/2, 11, 1/2GATE-CS-2003 Probability Discuss itQuestion 3-Explanation: Given, , We need to find the conditional probability of two given events without being told about . Also it is not mentioned that they are independent events. But since is 1, it means that covers the complete sample space. So, Question 4Let A be a sequence of 8 distinct integers sorted in ascending order. How many distinct pairs of sequences, B and C are there such that (i) each is sorted in ascending order, (ii) B has 5 and C has 3 elements, and (iii) the result of merging B and C gives A? 256 56 30 2 GATE-CS-2003 Combinatorics Discuss itQuestion 4-Explanation: Suppose you have selected 3 elements from 8 in 8C3 ways, the remaining elements are treated as another array and merging both the arrays gives the sorted array. Here, you can select either 3 or 5. => 8C3 = 8C5 = 8!/(3!5!) = 7*8 = 56 Ways. Question 5n couples are invited to a party with the condition that every husband should be accompanied by his wife. However, a wife need not be accompanied by her husband. The number of different gatherings possible at the party isABCDGATE-CS-2003 Combinatorics Discuss itQuestion 5-Explanation: There are three options for every couple. 1) Nobody goes to gathering 2) Wife alone goes 2) Both goSince there are n couples, total possible ways of gathering are 3nQuestion 6Let T(n) be the number of different binary search trees on n distinct elements. Then , where x isn-k+1n-kn-k-1n-k-2GATE-CS-2003 Top MCQs on Binary Search Tree (BST) Data Structure with Answers Discuss itQuestion 6-Explanation: The idea is to make a key root, put (k-1) keys in one subtree and remaining n-k keys in other subtree. A Binary Search Tree (BST) is a tree in which all the nodes follow the below-mentioned properties −The left sub-tree of a node has a key less than or equal to its parent node's key.The right sub-tree of a node has a key greater than to its parent node's key.Now construction binary search trees from n distinct number- Lets for simplicity consider n distinct numbers as first n natural numbers (starting from 1) If n=1 We have only one possibility, therefore only 1 BST. If n=2 We have 2 possibilities , when smaller number is root and bigger number is the right child or second when the bigger number is root and smaller number as left child. If n=3 We have 5 possibilities. Keeping each number first as root and then arranging the remaining 2 numbers as in case of n=2. If n=4 We have 14 possibilities. Taking each number as root and arranging smaal numbers as left subtree and larger numbers as right subtree. Thus we can conclude that with n distinct numbers, if we take ‘k’ as root then all the numbers smaller than k will left subtree and numbers larger than k will be right subtree where the the right subtree and left subtree will again be constructed recursively like the root. Therefore, This solution is contributed by Parul Sharma.Question 7Consider the set ∑* of all strings over the alphabet ∑ = {0, 1}. ∑* with the concatenation operator for stringsdoes not form a groupforms a non-commutative groupdoes not have a right identity elementforms a group if the empty string is removed from ∑*GATE-CS-2003 Set Theory & Algebra Discuss itQuestion 7-Explanation: The given set with the concatenation operator forms a Monoid as it follows the properties of Closure, Associativity and has an identity element(null string). It is not a Group since no element has an inverse element i.e. there is no string S for another string R such that S*R = null string.Question 8Let G be an arbitrary graph with n nodes and k components. If a vertex is removed from G, the number of components in the resultant graph must necessarily lie betweenk and nk - 1 and k + 1k - 1 and n - 1k + 1 and n - kGATE-CS-2003 Top MCQs on Graph Theory in Mathematics Discuss itQuestion 8-Explanation: Minimum: The removed vertex itself is a separate connected component. So removal of a vertex creates k-1 components. Maximum: It may be possible that the removed vertex disconnects all components. For example the removed vertex is center of a star. So removal creates n-1 components.Question 9Assuming all numbers are in 2's complement representation, which of the following numbers is divisible by 11111011?11100111111001001101011111011011GATE-CS-2003 Number Representation Discuss itQuestion 9-Explanation: Since most significant bit is 1, all numbers are negative. 2's complement of divisor (11111011) = 1's complement + 1 = 00000100 + 1 = 00000101 So the given number is -5 The decimal value of option A is -25Question 10For a pipelined CPU with a single ALU, consider the following situations1. The j + 1-st instruction uses the result of the j-th instruction as an operand 2. The execution of a conditional jump instruction 3. The j-th and j + 1-st instructions require the ALU at the same timeWhich of the above can cause a hazard ?1 and 2 only2 and 3 only3 onlyAll of aboveGATE-CS-2003 Computer Organization and Architecture Pipelining and Addressing modes Discuss itQuestion 10-Explanation: Case 1: Is of data dependency .this can’t be safe with single ALU so read after write. Case 2:Conditional jumps are always hazardous they create conditional dependency in pipeline. Case 3:This is write after read problem or concurrency dependency so hazardous All the three are hazardous So (D) is correct option. 123456789 There are 89 questions to complete.You have completedquestionsquestionYour accuracy isCorrectWrongPartial-CreditYou have not finished your quiz. If you leave this page, your progress will be lost.Correct AnswerYou SelectedNot AttemptedFinal Score on QuizAttempted Questions CorrectAttempted Questions WrongQuestions Not AttemptedTotal Questions on QuizQuestion DetailsResultsDateScoreHintTime allowedminutessecondsTime usedAnswer Choice(s) SelectedQuestion Text All doneNeed more practice!Keep trying!Not bad!Good work!Perfect!