The PYQ practice room
GATE CS 2014 Set 3
All 65 solved GATE CS 2014 Set 3 questions in exam order. Open a question, commit to an answer, and learn from the step-by-step solution. One question at a time.
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.Questions
65
Paper marks
100
Question formats
2
MCQ · NAT
Revision mode
Self-paced
No timer. Focus on understanding.
Explore the questions
General Aptitude (GA)
101
Q1MCQ1 markEasyWhile an envelope ,…Think it through. Then check your answer.Question
While an envelope , and .Which one of the above underlined parts of the sentence is NOT appropriate?Correct answer
(D) IV
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The sentence describes a sequence of events in the past. The phrase "Mr. X fell down" is in the simple past tense. To maintain parallel structure and logical sequence, the second part should also be in the simple past tense, i.e., "lost consciousness". The past continuous "was losing consciousness" implies an ongoing action, which does not fit well with the sudden event of falling down in this context. Therefore, part IV is not appropriate.2
Q2MCQ1 markEasyIf she _____________ how to calibrate the instrument, she _____________ done the experiment.Think it through. Then check your answer.Question
If she _____________ how to calibrate the instrument, she _____________ done the experiment.Correct answer
(C) had known, could have
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
This is a Type 3 conditional sentence (unreal past condition). The structure for a Type 3 conditional is: "If + past perfect, ... would/could/might + have + past participle".Option (C) follows this structure: "If she had known (past perfect) ..., she could have done (modal + have + past participle) ...".Other options do not follow the correct conditional grammar rules.3
Q3MCQ1 markEasyChoose the word that is opposite in meaning to the word “coherent”.Think it through. Then check your answer.Question
Choose the word that is opposite in meaning to the word “coherent”.Correct answer
(C) rambling
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Coherent means logical, consistent, and holding together well (of an argument or speech).Rambling means lengthy and confused or inconsequential (of speech or writing).Therefore, "rambling" is the opposite of "coherent".- Sticky: adhesive.
- Well-connected: having influential connections.
- Friendly: kind and pleasant.
4
Q4MCQ1 markEasyWhich number does not belong in the series below? 2, 5, 10, 17, 26, 37, 50, 64Think it through. Then check your answer.Question
Which number does not belong in the series below?
2, 5, 10, 17, 26, 37, 50, 64Correct answer
(C) 64
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The series follows the pattern :
The given number is 64, which should be 65. Thus, 64 does not belong in the series.5
Q5MCQ1 markEasyThe table below has question-wise data on the performance of students in an examination. The marks for each question are also listed. There is no negative or partial marking in…Think it through. Then check your answer.Question
The table below has question-wise data on the performance of students in an examination. The marks for each question are also listed. There is no negative or partial marking in the examination.What is the average of the marks obtained by the class in the examination?Q No. Marks Answered Correctly Answered Wrongly Not Attempted 1 2 21 17 6 2 3 15 27 2 3 2 23 18 3 Correct answer
(C) 3.02
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
First, calculate the total number of students. Since the data is question-wise, the sum of students in each category for any question gives the total class size.
For Q1:
For Q2:
For Q3:
Total students = 44.Next, calculate the total marks obtained by the class:- Q1 (2 marks): 21 students answered correctly. Marks =
- Q2 (3 marks): 15 students answered correctly. Marks =
- Q3 (2 marks): 23 students answered correctly. Marks =
6
Q6MCQ2 marksEasyA dance programme is scheduled for 10.00 a.m. Some students are participating in the programme and they need to come an hour earlier than the start of the event. These students…Think it through. Then check your answer.Question
A dance programme is scheduled for 10.00 a.m. Some students are participating in the programme and they need to come an hour earlier than the start of the event. These students should be accompanied by a parent. Other students and parents should come in time for the programme. The instruction you think that is appropriate for this isCorrect answer
(B) Participating students should come at 9.00 a.m. accompanied by a parent, and other parents and students should come by 10.00 a.m.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The problem states:1.Programme starts at 10.00 a.m.2.Participating students need to come an hour earlier (i.e., 9.00 a.m.) and must be accompanied by a parent.3.Other students and parents should come in time for the programme (i.e., 10.00 a.m.).Option (B) accurately captures all these conditions: "Participating students should come at 9.00 a.m. accompanied by a parent, and other parents and students should come by 10.00 a.m."7
Q7MCQ2 marksEasyBy the beginning of the century, several hypotheses were being proposed, suggesting a paradigm shift in our understanding of the universe. However, the clinching…Think it through. Then check your answer.Question
By the beginning of the century, several hypotheses were being proposed, suggesting a paradigm shift in our understanding of the universe. However, the clinching evidence was provided by experimental measurements of the position of a star which was directly behind our sun.Which of the following inference(s) may be drawn from the above passage?(i) Our understanding of the universe changes based on the positions of stars
(ii) Paradigm shifts usually occur at the beginning of centuries
(iii) Stars are important objects in the universe
(iv) Experimental evidence was important in confirming this paradigm shiftCorrect answer
(D) (iv) only
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To determine the correct inference(s) that can be logically drawn from the passage, we analyze each statement individually based only on the provided text:- Statement (i): "Our understanding of the universe changes based on the positions of stars"
- Analysis: The passage states that the position of a specific star behind the sun provided the "clinching evidence" for a particular paradigm shift. It does not state or imply a general rule that our understanding of the universe changes based on the positions of stars. This is an overgeneralization. Thus, (i) cannot be inferred.
- Statement (ii): "Paradigm shifts usually occur at the beginning of centuries"
- Analysis: The passage mentions that several hypotheses were proposed "by the beginning of the century." This is a specific historical observation about one event and does not support the general claim that paradigm shifts usually occur at the beginning of centuries. Thus, (ii) cannot be inferred.
- Statement (iii): "Stars are important objects in the universe"
- Analysis: While this statement is a generally accepted fact in astronomy, it is not an inference that can be drawn directly from the logical structure of the passage. The passage uses a star's position merely as a tool for experimental measurement in a specific instance. Thus, (iii) cannot be inferred.
- Statement (iv): "Experimental evidence was important in confirming this paradigm shift"
- Analysis: The passage explicitly states that "the clinching evidence was provided by experimental measurements of the position of a star...". The word "clinching" means decisive or confirming. Therefore, experimental evidence was indeed crucial in confirming this paradigm shift. Thus, (iv) is a valid inference.
8
Q8MCQ2 marksMediumThe Gross Domestic Product (GDP) in Rupees grew at during 2012-2013. For international comparison, the GDP is compared in US Dollars (USD) after conversion based on the…Think it through. Then check your answer.Question
The Gross Domestic Product (GDP) in Rupees grew at during 2012-2013. For international comparison, the GDP is compared in US Dollars (USD) after conversion based on the market exchange rate. During the period 2012-2013 the exchange rate for the USD increased from Rs. 50/ USD to Rs. 60/ USD. India’s GDP in USD during the period 2012-2013Correct answer
(D) decreased by 11%
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the percentage change in India's GDP in USD during the period 2012-2013, we can define the variables for the initial and final states.Let:- be the GDP in Rupees at the start of the period (2012).
- be the GDP in Rupees at the end of the period (2013).
- be the exchange rate at the start of the period: .
- be the exchange rate at the end of the period: .
Step 1: Express the final GDP in Rupees
The GDP in Rupees grew by during 2012-2013:Step 2: Calculate the GDP in USD for both periods
To convert the GDP from Rupees to USD, we divide the GDP in Rupees by the exchange rate (Rs./USD):- Initial GDP in USD ():
- Final GDP in USD ():
Step 3: Calculate the percentage change in USD GDP
The percentage change in GDP in USD is given by:Substitute the expressions for and :Now, calculate the percentage change:A change of approximately represents a decrease of about 11%.Correct Answer: Option D9
Q9MCQ2 marksEasyThe ratio of male to female students in a college for five years is plotted in the following line graph. If the number of female students in 2011 and 2012 is equal, what is the…Think it through. Then check your answer.Question
The ratio of male to female students in a college for five years is plotted in the following line graph. If the number of female students in 2011 and 2012 is equal, what is the ratio of male students in 2012 to male students in 2011?
Correct answer
(C) 1.5:1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the ratio of male students in 2012 to male students in 2011, we can analyze the data provided in the line graph.Step 1: Extract values from the graph
The graph plots the ratio of male to female students () for each year:- For the year 2011:
- For the year 2012:
Step 2: Use the given condition
We are given that the number of female students in 2011 and 2012 is equal:Substituting this into the equations for male students:Step 3: Calculate the required ratio
The ratio of male students in 2012 to male students in 2011 is:\frac{M_{2012}}{M_{2011}} = \frac{1.5 $\times$ F}{1.0 $\times$ F} = \frac{1.5}{1} = 1.5 : 1Thus, the ratio is 1.5:1.Correct Option: C10
Q10MCQ2 marksEasyConsider the equation: , where stands for X to the base N. Find Y.Think it through. Then check your answer.Question
Consider the equation: , where stands for X to the base N. Find Y.Correct answer
(C) 3142
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given the equation in base 8 (octal):Rearranging to solve for :Performing the subtraction in base 8: -----------1.Units place:2.Eights place: is not possible, so we borrow from the next higher place (the s place). In base 8, borrowing 1 adds 8 to the current digit. So, . The digit 5 in the s place becomes 4.3. s place:4. s place:The result is .Therefore, .
Computer Science
5511
Q11MCQ1 markEasyConsider the following statements: P: Good mobile phones are not cheap Q: Cheap mobile phones are not good L: P implies Q M: Q implies P N: P is equivalent to Q Which one of the…Think it through. Then check your answer.Question
Consider the following statements:P: Good mobile phones are not cheap
Q: Cheap mobile phones are not goodL: P implies Q
M: Q implies P
N: P is equivalent to QWhich one of the following about L, M, and N is CORRECT?Correct answer
(D) L, M and N are TRUE.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let denote " is a good mobile phone" and denote " is a cheap mobile phone".Statement P: "Good mobile phones are not cheap" can be written as:
Statement Q: "Cheap mobile phones are not good" can be written as:
The contrapositive of () is , which simplifies to .
Since a statement is logically equivalent to its contrapositive, .Therefore:- L: P implies Q is TRUE (since they are equivalent).
- M: Q implies P is TRUE (since they are equivalent).
- N: P is equivalent to Q is TRUE.
12
Q12MCQ1 markMediumLet and be finite sets and be a function. Which one of the following statements is TRUE?Think it through. Then check your answer.Question
Let and be finite sets and be a function. Which one of the following statements is TRUE?Correct answer
(D) For any subsets S and T of Y, f⁻¹(S ∩ T) = f⁻¹(S) ∩ f⁻¹(T)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's analyze the options:(A) : This is false. Generally, . Equality holds only if and are disjoint.(B) : This is false. The correct property is . Equality holds if is injective.(C) : This is false. Since , the size is bounded by the intersection size, but not necessarily the minimum of the image sizes.(D) : This is true. The inverse image of an intersection is the intersection of the inverse images.
Proof: .13
Q13NAT1 markEasyLet be a group with 15 elements. Let be a subgroup of . It is known that and that the size of is at least 4. The size of is __________.Think it through. Then check your answer.Question
Let be a group with 15 elements. Let be a subgroup of . It is known that and that the size of is at least 4. The size of is __________.Correct answer
5 to 5
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
According to Lagrange's Theorem, the order (size) of a subgroup must divide the order of the group .Given .
The divisors of 15 are 1, 3, 5, and 15.Conditions given:1..2.Size of is at least 4 .Checking the divisors:- 1: (False)
- 3: (False)
- 5: (True) and (True)
- 15: (False, since )
14
Q14MCQ1 markEasyWhich one of the following statements is TRUE about every matrix with only real eigenvalues?Think it through. Then check your answer.Question
Which one of the following statements is TRUE about every matrix with only real eigenvalues?Correct answer
(A) If the trace of the matrix is positive and the determinant of the matrix is negative, at least one of its eigenvalues is negative.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let be the real eigenvalues of an matrix.1.The determinant of a matrix is equal to the product of its eigenvalues: .2.If the determinant is negative (), then the product of the eigenvalues is negative. For a product of real numbers to be negative, there must be at least one negative number in the set. Therefore, at least one eigenvalue must be negative. This makes statement (A) true.Counter-examples for other options:- (B) Consider eigenvalues . The trace is , but one eigenvalue is negative.
- (C) Consider eigenvalues . The determinant is , but both eigenvalues are negative.
- (D) Consider eigenvalues . The trace is and the determinant is . Their product is , but two eigenvalues are negative.
15
Q15NAT1 markMediumIf and are 4-dimensional subspaces of a 6-dimensional vector space , then the smallest possible dimension of is ______.Think it through. Then check your answer.Question
If and are 4-dimensional subspaces of a 6-dimensional vector space , then the smallest possible dimension of is ______.Correct answer
2 to 2
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We use the dimension formula for subspaces:Rearranging to solve for the intersection:Given:
Substituting the values:To find the smallest possible dimension of , we must maximize .
Since is a subspace of , its dimension cannot exceed .Therefore:16
Q16NAT1 markMediumIf , then the value of is equal to ______ .Think it through. Then check your answer.Question
If , then the value of is equal to ______ .Correct answer
4 to 4
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We need to evaluate the integral .Since in the interval , we have .
The sign of changes at :- For , .
- For , .
Let
Let
Now, evaluate the definite integrals:1.For :2.For :Substitute back into the expression for :Given that , we have:The value of is 4.17
Q17MCQ1 markEasyConsider the following minterm expression for : The minterms 2, 7, 8 and 13 are 'do not care' terms. The minimal sum-of-products…Think it through. Then check your answer.Question
Consider the following minterm expression for :The minterms 2, 7, 8 and 13 are 'do not care' terms. The minimal sum-of-products form for isCorrect answer
(B) QS + QS
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The function is given by the minterms and don't-care terms .We construct a 4-variable K-map forF(P,Q,R,S):Grouping:00 01 11 10 00 () () 01 () () 11 () () 10 () () 1.Four Corners: Cells , , , and .- varies (), varies ().
- is constant , is constant .
- This group yields the term .
- varies (), varies ().
- is constant , is constant .
- This group yields the term .
18
Q18MCQ1 markEasyConsider the following combinational function block involving four Boolean variables where are inputs and is the output. [code] Which one of the…Think it through. Then check your answer.Question
Consider the following combinational function block involving four Boolean variables where are inputs and is the output.Which one of the following digital logic blocks is the most suitable for implementing this function?f (x, y, a, b) { if (x is 1) y = a; else y = b; }Correct answer
(C) Multiplexor
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The given code describes a function where the output depends on the value of the control variable .- If is 1, .
- If is 0 (else), .
19
Q19MCQ1 markEasyConsider the following processors (ns stands for nanoseconds). Assume that the pipeline registers have zero latency. P1: Four-stage pipeline with stage latencies ns, ns,…Think it through. Then check your answer.Question
Consider the following processors (ns stands for nanoseconds). Assume that the pipeline registers have zero latency.P1: Four-stage pipeline with stage latencies ns, ns, ns, ns.
P2: Four-stage pipeline with stage latencies ns, ns, ns, ns.
P3: Five-stage pipeline with stage latencies ns, ns, ns, ns, ns.
P4: Five-stage pipeline with stage latencies ns, ns, ns, ns, ns.Which processor has the highest peak clock frequency?Correct answer
(C) P3
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The clock period of a pipeline is determined by the stage with the maximum latency (bottleneck stage). The peak clock frequency is the inverse of the clock period.Given that pipeline registers have zero latency:
Clock Period () =
Frequency () = For P1:
Stage latencies: ns
ns
GHzFor P2:
Stage latencies: ns
ns
GHzFor P3:
Stage latencies: ns
ns
GHzFor P4:
Stage latencies: ns
ns
GHzComparing the frequencies:
Processor P3 has the highest peak clock frequency.20
Q20MCQ1 markMediumLet be a square matrix of size . Consider the following pseudocode. What is the expected output? [code]Think it through. Then check your answer.Question
Let be a square matrix of size . Consider the following pseudocode. What is the expected output?C = 100; for i = 1 to n do for j = 1 to n do { Temp = A[i][j] + C; A[i][j] = A[j][i]; A[j][i] = Temp - C; } for i = 1 to n do for j = 1 to n do output(A[i][j]);Correct answer
(A) The matrix A itself
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The pseudocode iterates through all elements of the matrix using nested loops for and from to . Inside the loop, it performs a swap operation between and using a temporary variable and an offset . Let's trace the operation for a pair of indices where :1.When : The code swaps and .2.When : The code swaps and again.Since the loops cover all pairs , every off-diagonal element is swapped twice, returning it to its original position. Diagonal elements () are swapped with themselves, remaining unchanged. Thus, the matrix remains unchanged.21
Q21NAT1 markMediumThe minimum number of arithmetic operations required to evaluate the polynomial for a given value of , using only one temporary variable is ______.Think it through. Then check your answer.Question
The minimum number of arithmetic operations required to evaluate the polynomial for a given value of , using only one temporary variable is ______.Correct answer
7 to 7
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We can rewrite the polynomial to minimize operations:Using one temporary variable and input :1. (Computes ) [1 mult]2. (Computes ) [1 add]3. (Computes ) [1 mult]4. (Computes ) [1 add]5. (Computes ) [1 mult]6. (Computes Result) [1 add]Total arithmetic operations = 3 multiplications + 3 additions = 6.22
Q22MCQ1 markMediumConsider the following rooted tree with the vertex labeled P as the root: [figure] The order in which the nodes are visited during an in-order traversal of the tree isThink it through. Then check your answer.Question
Consider the following rooted tree with the vertex labeled P as the root:The order in which the nodes are visited during an in-order traversal of the tree is
Correct answer
(A) SQPTRWUV
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
For a general tree interpreted for in-order traversal (often mapping to Left-Root-Right recursively):1.Left Subtree (Q): Q has child S. Treating S as the left child (since it appears first/below), the in-order isS → Q.2.Root: P.3.Right Subtree (R): R has children T, U, V. We visit the first child (T), then the root (R), then the remaining children.- Visit T.
- Visit R.
- Visit U's subtree: U has child W. Treating W as left child, in-order is
W → U. - Visit V.
- Sequence for R's subtree: .
This matches option (A).23
Q23NAT1 markMediumSuppose depth first search is executed on the graph below starting at some unknown vertex. Assume that a recursive call to visit a vertex is made only after first checking that…Think it through. Then check your answer.Question
Suppose depth first search is executed on the graph below starting at some unknown vertex. Assume that a recursive call to visit a vertex is made only after first checking that the vertex has not been visited earlier. Then the maximum possible recursion depth (including the initial call) is _________.
Correct answer
19 to 19
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The maximum recursion depth in a Depth First Search (DFS) is equal to the number of vertices in the graph if the graph is connected and contains a Hamiltonian path.1.Counting the vertices:- The left grid is a grid, which has vertices.
- There is a bridge consisting of vertex connecting the two main components.
- The right component consists of a grid with the center vertex missing ( vertices) and one additional vertex connected to the right side.
- Total vertices vertices.
24
Q24MCQ1 markEasyYou have an array of elements. Suppose you implement quicksort by always choosing the central element of the array as the pivot. Then the tightest upper bound for the worst…Think it through. Then check your answer.Question
You have an array of elements. Suppose you implement quicksort by always choosing the central element of the array as the pivot. Then the tightest upper bound for the worst case performance isCorrect answer
(A) O(n²)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Quicksort's worst-case time complexity is . This occurs when the pivot selection consistently results in highly unbalanced partitions (e.g., one partition has elements and the other has ). Choosing the middle element as a pivot is a fixed-position strategy and does not prevent the worst-case scenario; specific input sequences can still be constructed to trigger performance. Therefore, the tightest upper bound for the worst case remains .25
Q25NAT1 markMediumThe length of the shortest string NOT in the language (over ) of the following regular expression is ______________.Think it through. Then check your answer.Question
The length of the shortest string NOT in the language (over ) of the following regular expression is ______________.Correct answer
3 to 3
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let the language be . We check strings of increasing length over :- Length 0: is in (take all exponents as ).
- Length 1: (), () are in .
- Length 2:
- ()
- ()
- ()
- ()
- Length 3:
- ()
- ()
- ()
- ()
- ()
- : To form , the first must come from or . If from , we need from , which is impossible. If from , it must be , leaving to be matched by , which is impossible. Thus, .
- ()
- ()
26
Q26MCQ1 markEasyLet be a finite non-empty alphabet and let be the power set of . Which one of the following is TRUE?Think it through. Then check your answer.Question
Let be a finite non-empty alphabet and let be the power set of . Which one of the following is TRUE?Correct answer
(C) 2^(Σ^) is uncountable and Σ^ is countable
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
is the set of all finite strings over the alphabet . Since is finite and non-empty, is countably infinite (enumerable). The power set of a countably infinite set, , is uncountable (Cantor's Theorem). Therefore, is countable and is uncountable.27
Q27MCQ1 markEasyOne of the purposes of using intermediate code in compilers is toThink it through. Then check your answer.Question
One of the purposes of using intermediate code in compilers is toCorrect answer
(C) increase the chances of reusing the machine-independent code optimizer in other compilers.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Intermediate code generation provides a machine-independent representation of the source code. This allows for machine-independent optimizations to be performed on the intermediate code, which can then be reused across different back-ends (target machines) or front-ends (source languages). This modularity increases reusability.28
Q28MCQ1 markMediumWhich of the following statements are CORRECT? 1) Static allocation of all data areas by a compiler makes it impossible to implement recursion. 2) Automatic garbage collection is…Think it through. Then check your answer.Question
Which of the following statements are CORRECT?
1) Static allocation of all data areas by a compiler makes it impossible to implement recursion.
2) Automatic garbage collection is essential to implement recursion.
3) Dynamic allocation of activation records is essential to implement recursion.
4) Both heap and stack are essential to implement recursion.Correct answer
(D) 1 and 3 only
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1) True: Static allocation assigns fixed memory addresses at compile time. Recursion requires multiple instances of local variables for each active call, which is impossible if addresses are fixed statically.
2) False: Garbage collection is for memory management of heap-allocated objects, not strictly required for the mechanism of recursion itself (e.g., C supports recursion without GC).
3) True: Recursion requires a stack to store activation records (local variables, return addresses) for each function call dynamically as the recursion depth increases.
4) False: While a stack is essential, a heap is not strictly required for recursion itself (only for dynamic data structures).Thus, statements 1 and 3 are correct.29
Q29MCQ1 markEasyIn the context of modular software design, which one of the following combinations is desirable?Think it through. Then check your answer.Question
In the context of modular software design, which one of the following combinations is desirable?Correct answer
(B) High cohesion and low coupling
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In modular software design, cohesion refers to the degree to which the elements inside a module belong together. High cohesion is desirable because it means the module focuses on a single task or responsibility.Coupling refers to the degree of interdependence between software modules. Low coupling is desirable because it means modules are independent and changes in one module have minimal impact on others.Therefore, the desirable combination is High cohesion and low coupling.30
Q30NAT1 markEasyA system uses 3 page frames for storing process pages in main memory. It uses the Least Recently Used (LRU) page replacement policy. Assume that all the page frames are initially…Think it through. Then check your answer.Question
A system uses 3 page frames for storing process pages in main memory. It uses the Least Recently Used (LRU) page replacement policy. Assume that all the page frames are initially empty. What is the total number of page faults that will occur while processing the page reference string given below?Correct answer
6 to 6
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We have 3 page frames and use the LRU policy. The reference string is: 4, 7, 6, 1, 7, 6, 1, 2, 7, 2.1.Ref 4: Miss. Frames: [4, -, -]. Faults: 1.2.Ref 7: Miss. Frames: [4, 7, -]. Faults: 2.3.Ref 6: Miss. Frames: [4, 7, 6]. Faults: 3.4.Ref 1: Miss. Replace LRU (4). Frames: [1, 7, 6]. Faults: 4.5.Ref 7: Hit. Update LRU. Frames: [1, 6, 7] (7 is MRU). Faults: 4.6.Ref 6: Hit. Update LRU. Frames: [1, 7, 6] (6 is MRU). Faults: 4.7.Ref 1: Hit. Update LRU. Frames: [7, 6, 1] (1 is MRU). Faults: 4.8.Ref 2: Miss. Replace LRU (7). Frames: [2, 6, 1]. Faults: 5.9.Ref 7: Miss. Replace LRU (6). Frames: [2, 7, 1]. Faults: 6.10.Ref 2: Hit. Update LRU. Frames: [7, 1, 2] (2 is MRU). Faults: 6.Total page faults = 6.31
Q31MCQ1 markEasyWhat is the optimized version of the relation algebra expression , where are sets of attributes in with…Think it through. Then check your answer.Question
What is the optimized version of the relation algebra expression , where are sets of attributes in with and are Boolean expressions based on the attributes in ?Correct answer
(A) π_(A1)(σ_((F1 ∧ F2))(r))
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The expression is .1.Selection Optimization: A sequence of selection operations is equivalent to a single selection with the conjunction (AND) of the predicates. Therefore, .2.Projection Optimization: A sequence of projection operations where is equivalent to simply , because the outer projection restricts the attributes further to , which are already present in .Combining these, the optimized expression is .32
Q32MCQ1 markEasyA prime attribute of a relation scheme is an attribute that appearsThink it through. Then check your answer.Question
A prime attribute of a relation scheme is an attribute that appearsCorrect answer
(B) in some candidate key of R.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A prime attribute is defined as an attribute that is a member of at least one candidate key of the relation schema . Non-prime attributes are those that do not belong to any candidate key.33
Q33MCQ1 markEasyIn the following pairs of OSI protocol layer/sub-layer and its functionality, the INCORRECT pair isThink it through. Then check your answer.Question
In the following pairs of OSI protocol layer/sub-layer and its functionality, the INCORRECT pair isCorrect answer
(B) Data Link Layer and Bit synchronization
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Bit synchronization is a functionality of the Physical Layer, not the Data Link Layer. The Data Link Layer is responsible for framing, physical addressing, flow control, error control, and access control. The Network layer handles routing. The Transport layer handles end-to-end process communication. The MAC sub-layer handles channel sharing.34
Q34MCQ1 markMediumA bit-stuffing based framing protocol uses an 8-bit delimiter pattern of 01111110. If the output bit-string after stuffing is 01111100101, then the input bit-string isThink it through. Then check your answer.Question
A bit-stuffing based framing protocol uses an 8-bit delimiter pattern of 01111110. If the output bit-string after stuffing is 01111100101, then the input bit-string isCorrect answer
(B) 0111110101
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The delimiter is01111110. In bit stuffing, a0is inserted after every five consecutive1s in the data to prevent the delimiter pattern from appearing in the payload.Received string:01111100101Scanning the string:- We see
011111(five consecutive 1s). - The next bit is
0. This0was stuffed by the sender. - We remove this stuffed
0.
011111+0101=0111110101- We see
35
Q35MCQ1 markEasyHost A (on TCP/IP v4 network A) sends an IP datagram D to host B (also on TCP/IP v4 network B). Assume that no error occurred during the transmission of D. When D reaches B, which…Think it through. Then check your answer.Question
Host A (on TCP/IP v4 network A) sends an IP datagram D to host B (also on TCP/IP v4 network B). Assume that no error occurred during the transmission of D. When D reaches B, which of the following IP header field(s) may be different from that of the original datagram D?(i) TTL
(ii) Checksum
(iii) Fragment OffsetCorrect answer
(D) (i), (ii) and (iii)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.TTL (Time To Live): Decremented by at least 1 at each router (hop). Thus, it changes.2.Checksum: Since the TTL field changes at each hop, the IP header checksum must be recomputed and updated at each router. Thus, it changes.3.Fragment Offset: If the packet size exceeds the MTU of a link along the path, the router may fragment the packet. In this case, the Fragment Offset field will be modified in the fragments. The question asks what may be different. Since fragmentation is a possibility, this field may change.Therefore, (i), (ii), and (iii) may be different.36
Q36NAT2 marksMediumAn IP router implementing Classless Inter-domain Routing (CIDR) receives a packet with address 131.23.151.76. The router’s routing table has the following entries: | Prefix |…Think it through. Then check your answer.Question
An IP router implementing Classless Inter-domain Routing (CIDR) receives a packet with address 131.23.151.76. The router’s routing table has the following entries:The identifier of the output interface on which this packet will be forwarded is ______.Prefix Output Interface Identifier 131.16.0.0/ 12 3 131.28.0.0/ 14 5 131.19.0.0/ 16 2 131.22.0.0/ 15 1 Correct answer
1 to 1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We need to find the Longest Prefix Match for the destination IP address .IP Address:
First octet matches all entries.
Second octet in binary: Let's check each entry:1.131.16.0.0/12: Mask length 12. First 8 bits match (131). Next 4 bits of 16 () are . Next 4 bits of 23 () are . Match.2.131.28.0.0/14: Mask length 14. First 8 bits match. Next 6 bits of 28 () are . Next 6 bits of 23 () are . Mismatch.3.131.19.0.0/16: Mask length 16. Second octet 19 (). Mismatch.4.131.22.0.0/15: Mask length 15. First 8 bits match. Next 7 bits of 22 () are . Next 7 bits of 23 () are . Match.Matches found:- Interface 3 (Length 12)
- Interface 1 (Length 15)
Therefore, the packet is forwarded to interface 1.37
Q37NAT2 marksHardEvery host in an IPv4 network has a 1-second resolution real-time clock with battery backup. Each host needs to generate up to 1000 unique identifiers per second. Assume that each…Think it through. Then check your answer.Question
Every host in an IPv4 network has a 1-second resolution real-time clock with battery backup. Each host needs to generate up to 1000 unique identifiers per second. Assume that each host has a globally unique IPv4 address. Design a 50-bit globally unique ID for this purpose. After what period (in seconds) will the identifiers generated by a host wrap around?Correct answer
256 to 256
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To ensure the ID is globally unique, we must include the host's unique IPv4 address.Total ID length = 50 bits.
IPv4 Address length = 32 bits.Bits remaining for local uniqueness = bits.These 18 bits are used to generate unique identifiers within the host. The host generates up to 1000 identifiers per second.Total number of unique values possible with 18 bits = .Since 1000 identifiers are consumed per second, the time to wrap around is:The answer is approximately 262 seconds.38
Q38MCQ2 marksMediumAn IP router with a Maximum Transmission Unit (MTU) of 1500 bytes has received an IP packet of size 4404 bytes with an IP header of length 20 bytes. The values of the relevant…Think it through. Then check your answer.Question
An IP router with a Maximum Transmission Unit (MTU) of 1500 bytes has received an IP packet of size 4404 bytes with an IP header of length 20 bytes. The values of the relevant fields in the header of the third IP fragment generated by the router for this packet areCorrect answer
(A) MF bit: 0, Datagram Length: 1444; Offset: 370
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Total packet size = 4404 bytes.
IP Header = 20 bytes.
Data payload = bytes.MTU = 1500 bytes.
Max payload per fragment = bytes.
Since the offset must be a multiple of 8, and 1480 is divisible by 8 (), the max fragment size is valid.Fragment 1:
Bytes 0 to 1479 (1480 bytes).
Offset = 0.
MF = 1.Fragment 2:
Bytes 1480 to 2959 (1480 bytes).
Offset = .
MF = 1.Fragment 3:
Remaining bytes = bytes.
Bytes 2960 to 4383.
Offset = .
Total Length = bytes.
MF = 0 (Last fragment).Thus, MF bit: 0, Datagram Length: 1444, Offset: 370.39
Q39MCQ2 marksMediumConsider the transactions , , and and the schedules and given below. [code] Which one of the following statements about the schedules is TRUE?Think it through. Then check your answer.Question
Consider the transactions , , and and the schedules and given below.Which one of the following statements about the schedules is TRUE?T1: r1(X); r1(Z); w1(X); w1(Z) T2: r2(Y); r2(Z); w2(Z) T3: r3(Y); r3(X); w3(Y) S1: r1(X); r3(Y); r3(X); r2(Y); r2(Z); w3(Y); w2(Z); r1(Z); w1(X); w1(Z) S2: r1(X); r3(Y); r2(Y); r3(X); r1(Z); r2(Z); w3(Y); w1(X); w2(Z); w1(Z)Correct answer
(A) Only S₁ is conflict-serializable.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To determine conflict serializability, we construct the precedence graph for each schedule.For Schedule :- comes before : Edge
- comes before : Edge
- comes before : Edge
- comes before : Edge
There are no cycles. Thus, is conflict-serializable.For Schedule :- comes before : Edge
- comes before : Edge
- comes before : Edge
This forms a cycle (). Thus, is NOT conflict-serializable.Therefore, only is conflict-serializable.40
Q40MCQ2 marksMediumConsider the relational schema given below, where eId of the relation dependent is a foreign key referring to empId of the relation employee. Assume that every…Think it through. Then check your answer.Question
Consider the relational schema given below, where eId of the relation dependent is a foreign key referring to empId of the relation employee. Assume that every employee has at least one associated dependent in the dependent relation.employee (empId, empName, empAge)
dependent (depId, eId, depName, depAge)Consider the following relational algebra query:The above query evaluates to the set of empIds of employees whose age is greater than that ofCorrect answer
(D) all of his/her dependents.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The query can be broken down as follows:1.: Returns all employee IDs.2.: Returns the IDs of employees who have at least one dependent such that the employee's age is less than or equal to the dependent's age.Subtracting set (2) from set (1) gives the IDs of employees who do NOT satisfy the condition in (2).So, we are looking for employees who do not have any dependent with .
This implies that for all of their dependents, the condition must be false, i.e., .Thus, the query returns employees whose age is greater than that of all of his/her dependents.41
Q41NAT2 marksEasyA system contains three programs and each requires three tape units for its operation. The minimum number of tape units which the system must have such that deadlocks never arise…Think it through. Then check your answer.Question
A system contains three programs and each requires three tape units for its operation. The minimum number of tape units which the system must have such that deadlocks never arise is _________.Correct answer
7 to 7
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let be the number of processes and be the max demand of each process.
Given:
The condition for deadlock-free operation is:
where is the number of resources (tape units).Substituting the values:
Thus, the minimum number of tape units required is 7.42
Q42NAT2 marksMediumAn operating system uses shortest remaining time first scheduling algorithm for pre-emptive scheduling of processes. Consider the following set of processes with their arrival…Think it through. Then check your answer.Question
An operating system uses shortest remaining time first scheduling algorithm for pre-emptive scheduling of processes. Consider the following set of processes with their arrival times and CPU burst times (in milliseconds):The average waiting time (in milliseconds) of the processes is _________.Process Arrival Time Burst Time P1 0 12 P2 2 4 P3 3 6 P4 8 5 Correct answer
5.5 to 5.5
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Using Shortest Remaining Time First (SRTF) scheduling:Gantt Chart Analysis:- Time 0: P1 arrives (Burst 12). P1 starts.
- Time 2: P2 arrives (Burst 4). P1 has run for 2ms, remaining = 10. P2(4) < P1(10), so preempt P1. P2 starts.
- Time 3: P3 arrives (Burst 6). P2 has run for 1ms, remaining = 3. P2(3) < P3(6). Continue P2.
- Time 6: P2 finishes. Ready queue: P1(10), P3(6). P3(6) < P1(10). P3 starts.
- Time 8: P4 arrives (Burst 5). P3 has run for 2ms, remaining = 4. P4(5) > P3(4). Continue P3.
- Time 12: P3 finishes. Ready queue: P1(10), P4(5). P4(5) < P1(10). P4 starts.
- Time 17: P4 finishes. Ready queue: P1(10). P1 starts.
- Time 27: P1 finishes.
- P1: 27
- P2: 6
- P3: 12
- P4: 17
- P1:
- P2:
- P3:
- P4:
- P1:
- P2:
- P3:
- P4:
ms.43
Q43NAT2 marksMediumConsider a paging hardware with a TLB. Assume that the entire page table and all the pages are in the physical memory. It takes 10 milliseconds to search the TLB and 80…Think it through. Then check your answer.Question
Consider a paging hardware with a TLB. Assume that the entire page table and all the pages are in the physical memory. It takes 10 milliseconds to search the TLB and 80 milliseconds to access the physical memory. If the TLB hit ratio is 0.6, the effective memory access time (in milliseconds) is _________.Correct answer
122 to 122
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let be the TLB search time, be the memory access time, and be the hit ratio.
Given:
ms
ms
Case 1: TLB Hit
Time = (Search TLB + Access Data)
Time = msCase 2: TLB Miss
Time = (Search TLB + Access Page Table + Access Data)
Time = msEffective Memory Access Time (EMAT):
ms44
Q44MCQ2 marksMediumConsider the basic block given below. [code] The minimum number of nodes and edges present in the DAG representation of the above basic block respectively areThink it through. Then check your answer.Question
Consider the basic block given below.The minimum number of nodes and edges present in the DAG representation of the above basic block respectively area = b + c c = a + d d = b + c e = d - b a = e + bCorrect answer
(A) 6 and 6
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the minimum number of nodes and edges in the Directed Acyclic Graph (DAG) for the basic block, we process each statement while reusing existing nodes for common subexpressions and identifying redundant operations.1.: Create leaf nodes for the initial values of and (let's call them and ). Create an internal node for the operator '+' with children and . Node is labeled with .- Nodes: (3 nodes)
- Edges: (2 edges)
- Nodes: (5 nodes)
- Edges: (4 edges)
- Nodes: (6 nodes)
- Edges: (6 edges)
5.: The current value of is . Thus, is . We already have a node representing . Since addition is commutative, now points to the existing node . No new nodes or edges are added.Final counts:- Nodes: 6
- Edges: 6
45
Q45MCQ2 marksEasyWhich one of the following problems is undecidable?Think it through. Then check your answer.Question
Which one of the following problems is undecidable?Correct answer
(A) Deciding if a given context-free grammar is ambiguous.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The problem of determining whether a given Context-Free Grammar (CFG) is ambiguous is known to be undecidable. There is no algorithm that can determine for an arbitrary CFG whether it is ambiguous or not.Let's analyze the other options:- (B) Membership problem for CFGs (is string in
L(G)?) is decidable (e.g., using the CYK algorithm). - (C) Emptiness problem for CFGs (is ?) is decidable (check if the start symbol can generate any terminal string).
- (D) Finiteness problem for CFGs (is
L(G)finite?) is decidable (check for loops in the dependency graph of variables that can generate terminals).
- (B) Membership problem for CFGs (is string in
46
Q46MCQ2 marksMediumConsider the following languages over the alphabet :
…Think it through. Then check your answer.Question
Consider the following languages over the alphabet :
Here, is the reverse of the string . Which of these languages are deterministic Context-free languages?Correct answer
(C) Only L₁ and L₂
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's analyze each language:1.: This is a standard Deterministic Context-Free Language (DCFL). A Deterministic Pushdown Automaton (DPDA) can push all 0s onto the stack and then pop one 0 for each 1 read. If the stack is empty exactly when the input ends, accept.2.: This is also a DCFL. The character 'c' acts as a clear center marker. A DPDA can push the symbols of onto the stack. When 'c' is read, it transitions to a state that pops symbols from the stack and compares them with the remaining input . Since the transition is determined by the input symbol 'c', it is deterministic.3.: This is a Context-Free Language (CFL) but not a DCFL. Without the center marker, the automaton has to "guess" where the middle of the string is to switch from pushing to popping/matching. This non-determinism cannot be removed for this specific language.Thus, only and are deterministic context-free languages.47
Q47NAT2 marksMediumSuppose you want to move from 0 to 100 on the number line. In each step, you either move right by a unit distance or you take a shortcut. A shortcut is simply a pre-specified pair…Think it through. Then check your answer.Question
Suppose you want to move from 0 to 100 on the number line. In each step, you either move right by a unit distance or you take a shortcut. A shortcut is simply a pre-specified pair of integers with . Given a shortcut if you are at position on the number line, you may directly move to . Suppose denotes the smallest number of steps needed to move from to 100. Suppose further that there is at most 1 shortcut involving any number, and in particular from 9 there is a shortcut to 15. Let and be such that . Then the value of the product is _____.Correct answer
150 to 150
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
From any position , we can move to (1 step). If there is a shortcut from to , we can also move to (1 step).Given:- From 9, there is a shortcut to 15.
- is the minimum steps from to 100.
- .
1.Move by unit distance: .2.Take the shortcut: .Thus, the recurrence relation for is:Comparing this with the given equation , we have the set .The product .48
Q48MCQ2 marksMediumConsider the decision problem 2CNFSAT defined as follows: …Think it through. Then check your answer.Question
Consider the decision problem 2CNFSAT defined as follows:For example, is a Boolean formula and it is in 2CNFSAT.The decision problem 2CNFSAT isCorrect answer
(B) solvable in polynomial time by reduction to directed graph reachability.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
2-SAT (or 2CNFSAT) is the problem of determining if a boolean formula in 2-CNF is satisfiable. It is known to be in P (Polynomial Time).The standard algorithm to solve 2-SAT involves constructing an implication graph where each clause is represented as two directed edges: and . The formula is unsatisfiable if and only if there exists a variable such that there is a path from to and a path from to in this graph (i.e., they belong to the same Strongly Connected Component).This reduces the problem to finding strong connected components or checking reachability in a directed graph, which can be done in linear time .Thus, it is solvable in polynomial time by reduction to directed graph reachability.49
Q49NAT2 marksMediumSuppose we have a balanced binary search tree holding numbers. We are given two numbers and and wish to sum up all the numbers in that lie between and .…Think it through. Then check your answer.Question
Suppose we have a balanced binary search tree holding numbers. We are given two numbers and and wish to sum up all the numbers in that lie between and . Suppose there are such numbers in . If the tightest upper bound on the time to compute the sum is , the value of is _____.Correct answer
110 to 110
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To sum all numbers between and in a standard balanced Binary Search Tree (BST) without augmentation (like subtree sums):1.Search for : This takes time to find the first node .2.Traverse: Perform an in-order traversal from that node until we reach a node . Since there are nodes in the range, we will visit nodes. In a BST, finding the successor takes amortized constant time, or simply traversing nodes takes time (the accounts for the initial search and the path back up/down).The total time complexity is .Matching this with the given form :- The term corresponds to , so .
- The term corresponds to , so .
Calculation:
.50
Q50MCQ2 marksMediumConsider a hash table with 100 slots. Collisions are resolved using chaining. Assuming simple uniform hashing, what is the probability that the first 3 slots are unfilled after…Think it through. Then check your answer.Question
Consider a hash table with 100 slots. Collisions are resolved using chaining. Assuming simple uniform hashing, what is the probability that the first 3 slots are unfilled after the first 3 insertions?Correct answer
(A) (97 × 97 × 97)/100³
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Total number of slots .
Number of insertions .
We want the probability that the first 3 slots (indices 0, 1, 2) are unfilled.Under simple uniform hashing, each key is equally likely to be hashed to any of the slots with probability .For a single insertion, the probability that it does not hash to any of the first 3 slots is:Since the hash values are independent for each insertion:Thus, option (A) is correct.51
Q51MCQ2 marksMediumConsider the pseudocode given below. The functionDoSomething()takes as argument a pointer to the root of an arbitrary tree represented by the *leftMostChild-rightSibling*…Think it through. Then check your answer.Question
Consider the pseudocode given below. The functionDoSomething()takes as argument a pointer to the root of an arbitrary tree represented by the leftMostChild-rightSibling representation. Each node of the tree is of typetreeNode.When the pointer to the root of a tree is passed as the argument totypedef struct treeNode* treeptr; struct treeNode { treeptr leftMostChild, rightSibling; }; int DoSomething (treeptr tree) { int value=0; if (tree != NULL) { if (tree->leftMostChild == NULL) value = 1; else value = DoSomething(tree->leftMostChild); value = value + DoSomething(tree->rightSibling); } return(value); }DoSomething, the value returned by the function corresponds to theCorrect answer
(D) number of leaf nodes in the tree.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The functionDoSomethingtraverses the tree using the Left-Child Right-Sibling representation.Let's analyze the logic:1.IftreeisNULL, it returns 0.2.Iftree->leftMostChild == NULL, it means the node has no children. In a general tree, a node with no children is a leaf. In this case,valueis set to 1.3.Iftree->leftMostChild != NULL, it recursively callsDoSomethingon the first child. This sums up the values from the children.4.Finally, it addsEssentially, for any node:DoSomething(tree->rightSibling). This adds the result from the siblings.- If it is a leaf, it contributes 1 to the sum.
- If it is an internal node, it contributes the sum of the results of its children.
- The function also sums across all siblings.
52
Q52MCQ2 marksMediumConsider the C function given below. Assume that the arraylistAcontainsn(> 0) elements, sorted in ascending order. [code] Which one of the following statements about the…Think it through. Then check your answer.Question
Consider the C function given below. Assume that the arraylistAcontainsn(> 0) elements, sorted in ascending order.Which one of the following statements about the functionint ProcessArray(int *listA, int x, int n) { int i, j, k; i = 0; j = n-1; do { k = (i+j)/2; if (x <= listA[k]) j = k-1; if (listA[k] <= x) i = k+1; }while (i <= j); if (listA[k] == x) return(k); else return -1; }ProcessArrayis CORRECT?Correct answer
(B) It is an implementation of binary search.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The function implements a variation of binary search.Trace:- The loop continues as long as
i <= j. kis the middle index.- If
x <= listA[k], the upper boundjis moved tok-1. - If
listA[k] <= x, the lower boundiis moved tok+1.
listA[k] == x:- Both conditions are true.
jbecomesk-1andibecomesk+1.- The loop condition
i <= jbecomes false (sincek+1 > k-1), and the loop terminates. - After the loop,
listA[k] == xis checked. Sincekholds the index where the match was found, it returnsk.
xis not in the array:- The range
[i, j]shrinks untili > jwithout ever hitting the equality case simultaneously (or if it does,listA[k]won't bexunlessxwas found). - The loop terminates, and the final check
listA[k] == xfails, returning -1.
xin the sorted arraylistA.- The loop continues as long as
53
Q53NAT2 marksHardAn instruction pipeline has five stages, namely, instruction fetch (IF), instruction decode and register fetch (ID/RF), instruction execution (EX), memory access (MEM), and…Think it through. Then check your answer.Question
An instruction pipeline has five stages, namely, instruction fetch (IF), instruction decode and register fetch (ID/RF), instruction execution (EX), memory access (MEM), and register writeback (WB) with stage latencies 1 ns, 2.2 ns, 2 ns, 1 ns, and 0.75 ns, respectively (ns stands for nanoseconds). To gain in terms of frequency, the designers have decided to split the ID/RF stage into three stages (ID, RF1, RF2) each of latency ns. Also, the EX stage is split into two stages (EX1, EX2) each of latency 1 ns. The new design has a total of eight pipeline stages. A program has 20% branch instructions which execute in the EX stage and produce the next instruction pointer at the end of the EX stage in the old design and at the end of the EX2 stage in the new design. The IF stage stalls after fetching a branch instruction until the next instruction pointer is computed. All instructions other than the branch instruction have an average CPI of one in both the designs. The execution times of this program on the old and the new design are and nanoseconds, respectively. The value of is __________.Correct answer
1.5 to 1.6
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
For the old design ():- Stages: IF, ID/RF, EX, MEM, WB (5 stages).
- Stage latencies: 1, 2.2, 2, 1, 0.75 ns.
- Clock cycle time ns.
- Branch outcome known at end of EX stage (3rd stage).
- Stall cycles for branch: The instruction is fetched (1), then stalls during ID/RF (2) and EX (3). The next instruction is fetched in cycle 4. So, penalty is stall cycles.
- Average CPI (): .
- Execution time per instruction: ns.
- Stages: IF, ID, RF1, RF2, EX1, EX2, MEM, WB (8 stages).
- Stage latencies: 1, , , , 1, 1, 1, 0.75 ns.
- Clock cycle time ns.
- Branch outcome known at end of EX2 stage (6th stage).
- Stall cycles for branch: The instruction is fetched (1), then stalls during ID, RF1, RF2, EX1, EX2. The next instruction is fetched in cycle 7. So, penalty is stall cycles.
- Average CPI (): .
- Execution time per instruction: ns.
54
Q54NAT2 marksMediumThe memory access time is 1 nanosecond for a read operation with a hit in cache, 5 nanoseconds for a read operation with a miss in cache, 2 nanoseconds for a write operation with…Think it through. Then check your answer.Question
The memory access time is 1 nanosecond for a read operation with a hit in cache, 5 nanoseconds for a read operation with a miss in cache, 2 nanoseconds for a write operation with a hit in cache and 10 nanoseconds for a write operation with a miss in cache. Execution of a sequence of instructions involves 100 instruction fetch operations, 60 memory operand read operations and 40 memory operand write operations. The cache hit-ratio is 0.9. The average memory access time (in nanoseconds) in executing the sequence of instructions is __________.Correct answer
1.68 to 1.68
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We calculate the total time taken for all memory accesses and divide by the total number of accesses.1. Instruction Fetches (Read):- Count: 100
- Hit time: 1 ns, Miss time: 5 ns
- Hits: . Time: ns.
- Misses: . Time: ns.
- Total Fetch Time: ns.
- Count: 60
- Hit time: 1 ns, Miss time: 5 ns
- Hits: . Time: ns.
- Misses: . Time: ns.
- Total Read Time: ns.
- Count: 40
- Hit time: 2 ns, Miss time: 10 ns
- Hits: . Time: ns.
- Misses: . Time: ns.
- Total Write Time: ns.
- Total Time = ns.
- Total Accesses = .
- Average = ns.
55
Q55MCQ2 marksMedium[figure] The above synchronous sequential circuit built using JK flip-flops is initialized with . The state sequence for this circuit for the next 3 clock cycles…Think it through. Then check your answer.Question

The above synchronous sequential circuit built using JK flip-flops is initialized with . The state sequence for this circuit for the next 3 clock cycles isCorrect answer
(C) 100, 110, 111
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Analyze the connections in the circuit diagram (a Johnson Counter configuration):- FF2 (): Inputs and are connected to and respectively (effectively ). So .
- FF1 (): Inputs and are connected to and respectively (effectively ). So .
- FF0 (): Inputs and are connected to and respectively (effectively ). So .
1.Initial: 0002.Cycle 1:- State: 100
- State: 110
- State: 111
56
Q56MCQ2 marksMediumWith respect to the numerical evaluation of the definite integral, , where and are given, which of the following statements is/are TRUE? I) The value…Think it through. Then check your answer.Question
With respect to the numerical evaluation of the definite integral, , where and are given, which of the following statements is/are TRUE?I) The value of obtained using the trapezoidal rule is always greater than or equal to the exact value of the definite integral.
II) The value of obtained using the Simpson's rule is always equal to the exact value of the definite integral.Correct answer
(C) Both I and II
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The function to be integrated is .Statement I: The Trapezoidal rule approximates the area under the curve by trapezoids. For a function with (concave up or convex) on the interval , the trapezoidal rule overestimates the integral. Since , , the graph is concave up. Thus, the trapezoidal approximation will be greater than the exact area. The statement says "greater than or equal to", which is true.Statement II: Simpson's rule (specifically Simpson's 1/3 rule) is exact for polynomials of degree up to 3. Since the integrand is a polynomial of degree 2 (), Simpson's rule will provide the exact value of the integral. Thus, this statement is true.Therefore, both statements are true.57
Q57MCQ2 marksEasyThe value of the integral given below isThink it through. Then check your answer.Question
The value of the integral given below isCorrect answer
(A) -2π
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let .
Using integration by parts: .
Let .
Let .Since and , the first term is 0.Now, integrate by parts again.
Let .
Let .Substituting back into the expression for :58
Q58NAT2 marksEasyLet be a sample space and two mutually exclusive events and be such that . If denotes the probability of the event, the maximum value of…Think it through. Then check your answer.Question
Let be a sample space and two mutually exclusive events and be such that . If denotes the probability of the event, the maximum value of is ______.Correct answer
0.25 to 0.25
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given that events and are mutually exclusive and , they form a partition of the sample space. Therefore:Let . Then .
We need to maximize the product .Let .
To find the maximum, take the derivative with respect to and set it to 0:The second derivative , which is negative, confirming a maximum.
The maximum value is:59
Q59MCQ2 marksHardConsider the set of all functions such that , for all . Consider the following statements:
…Think it through. Then check your answer.Question
Consider the set of all functions such that , for all . Consider the following statements:
. For each such function it must be the case that for every .
. For each such function it must be the case that for some .
. Each such function must be onto.Which one of the following is CORRECT?Correct answer
(B) Only Q and R are true
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The domain is . The size of the set is (an odd number).
The condition is for all . This means is an involution.Statement R: Since , has an inverse (which is itself). Any invertible function is a bijection, and thus must be onto. So, R is true.Statement Q: The condition implies that the permutation structure of consists of disjoint cycles of length 1 (fixed points where ) or length 2 (swaps where and ).
Let be the number of 2-cycles and be the number of 1-cycles.
The total number of elements is .
Since is always even and 2015 is odd, must be odd. Therefore, . This means there is at least one element such that . So, Q is true.Statement P: Does have to hold for every ? No. We can construct a function where some elements are swapped. For example, , and for . This satisfies but is not the identity function. So, P is false.Conclusion: Only Q and R are true.60
Q60NAT2 marksHardThere are two elements in a group such that every element in the group can be written as a product of some number of 's and 's in some order. It is known…Think it through. Then check your answer.Question
There are two elements in a group such that every element in the group can be written as a product of some number of 's and 's in some order. It is known thatwhere is the identity element. The maximum number of elements in such a group is __________.Correct answer
4 to 4
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given the group is generated by and , so every element is a product of 's and 's.
The relations are given as:1.2.3.4.From , we have . Multiplying by on the right:
(since ).
Multiplying by on the right:
(since ).Since , the generators commute, meaning the group is abelian. Any element in the group can be written in the form .
Using the relations and , the exponents and can only be or (modulo 2).The possible distinct elements are:1.2.3.4.Thus, the maximum number of elements in such a group is 4. This group is isomorphic to the Klein four-group ().61
Q61MCQ2 marksEasyIf is a forest with vertices and connected components, how many edges does have?Think it through. Then check your answer.Question
If is a forest with vertices and connected components, how many edges does have?Correct answer
(C) n - k
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A forest is a collection of disjoint trees. Let the forest have connected components (trees) denoted by .
Let be the number of vertices in the -th component . Then, the total number of vertices is .For any tree with vertices, the number of edges is .
Therefore, the number of edges in is .The total number of edges in the forest is the sum of the edges in each component:Thus, the number of edges is .62
Q62MCQ2 marksHardLet denote the minimum degree of a vertex in a graph. For all planar graphs on vertices with , which one of the following is TRUE?Think it through. Then check your answer.Question
Let denote the minimum degree of a vertex in a graph. For all planar graphs on vertices with , which one of the following is TRUE?Correct answer
(A) In any planar embedding, the number of faces is at least (n)/(2) + 2
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
For a connected planar graph, Euler's formula states , where . Thus, .The sum of degrees is . Since the minimum degree is , we have:Given , we have , or .Substituting this into the expression for :Thus, . This inequality holds for any planar embedding of such a graph.If the graph is not connected, let be the number of connected components. Euler's formula is . Then . Since , , and the same bound applies.63
Q63MCQ2 marksEasyThe CORRECT formula for the sentence, "not all rainy days are cold" isThink it through. Then check your answer.Question
The CORRECT formula for the sentence, "not all rainy days are cold" isCorrect answer
(D) ∃ d (Rainy(d) ∧ Cold(d))
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The sentence "not all rainy days are cold" translates to the negation of "all rainy days are cold"."All rainy days are cold" is represented as:The negation is:Using the equivalence , the negation becomes:This corresponds to option (D).64
Q64MCQ2 marksMediumConsider the following relational schema: employee(empId, empName, empDept) customer(custId, custName, salesRepId, rating)salesRepIdis a foreign key referring to…Think it through. Then check your answer.Question
Consider the following relational schema:employee(empId, empName, empDept)
customer(custId, custName, salesRepId, rating)salesRepIdis a foreign key referring toempIdof the employee relation. Assume that each employee makes a sale to at least one customer. What does the following query return?SELECT empName FROM employee E WHERE NOT EXISTS (SELECT custId FROM customer C WHERE C.salesRepId = E.empId AND C.rating <> 'GOOD');Correct answer
(D) Names of all the employees with all their customers having a ‘GOOD’ rating.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The SQL query selectsempNamefrom theemployeetable where a certain condition holds.The condition isWHERE NOT EXISTS (...). The subquery selects customers associated with the employee (C.salesRepId = E.empId) who have a rating that is not 'GOOD' (C.rating <> 'GOOD').So,NOT EXISTSreturns TRUE if there are no customers for that employee with a rating other than 'GOOD'. In other words, the set of customers with 'BAD' (or any non-GOOD) rating is empty.This implies that all customers associated with the employee must have a rating of 'GOOD'. Since the problem statement assumes each employee makes a sale to at least one customer, we don't need to worry about employees with zero customers (for whom the condition would also be vacuously true).Therefore, the query returns the names of employees where all their customers have a 'GOOD' rating.65
Q65MCQ2 marksEasyLet denote the Exclusive OR (XOR) operation. Let ‘1’ and ‘0’ denote the binary constants. Consider the following Boolean expression for over two variables and…Think it through. Then check your answer.Question
Let denote the Exclusive OR (XOR) operation. Let ‘1’ and ‘0’ denote the binary constants. Consider the following Boolean expression for over two variables and :The equivalent expression for isCorrect answer
(D) P ⊕ Q
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given the Boolean expression:We know that the XOR operation () is associative and commutative. Also, , , and .Let's simplify the expression step-by-step.Step 1: Simplify the left term
Step 2: Simplify the right term
Step 3: Combine the resultsUsing the definition of XOR ():This is the expression for the XNOR operation (equivalence), which is the complement of XOR:Thus, the equivalent expression is .