UGC NET CS Aug 2016
UGC NET JRF Computer Science · 2016 · with answers and explanations
- questions
- 7
- Total marks
- 14
- Duration
- 180 minutes
- Negative marking
- No
Subjects: Computer Science
Question 1
Computer Science · 2 marksConsider a system having 'm' resources of the same type. These resources are shared by three processes P1, P2 and P3 which have peak demands of 2, 5 and 7 resources respectively. For what value of 'm' will deadlock not occur?
- A.70
- D.7
- C.13
- B.14
Correct answer: C
Explanation: Minimum resources to avoid deadlock = (max1-1) + (max2-1) + (max3-1) + 1 = 1+4+6+1 = 12. But this gives the minimum safe value. With m=13, deadlock cannot occur because even if each process holds one less than its maximum, there is still one resource free.
Question 2
Computer Science · 2 marksConsider a system with seven processes A through G and six resources R through W. Process A holds R and wants T, process B holds nothing but wants T, process C holds nothing but wants S, process D holds U and wants S and T, process E holds T and wants V, process F holds W and wants S, process G holds V and wants U. Is the system deadlocked? If yes, which processes are deadlocked?
- D.Yes, A, B, F
- C.Yes, D, E, G
- B.Yes, A, B, C
- A.No
Correct answer: C
Explanation: D holds U, wants T -> E holds T, wants V -> G holds V, wants U -> D holds U. This forms a circular wait among D, E, G causing deadlock.
Question 3
Computer Science · 2 marksIn a fast Ethernet cabling, 100 Base-TX uses _____ cable and maximum segment size is _____.
- D.Fiber optics, 2000 meters
- C.Fiber optics, 1000 meters
- B.Twisted pair, 200 meters
- A.Twisted pair, 100 meters
Correct answer: A
Explanation: 100Base-TX uses Category 5 UTP (twisted pair) cable with a maximum segment length of 100 meters.
Question 4
Computer Science · 2 marksThe following C statement: int *f[](); declares:
- C.A function returning an array of pointers to integers
- D.An illegal statement
- B.Array of functions returning pointers to integers
- A.A function returning a pointer to an array of integers
Correct answer: B
Explanation: int *f[]() declares f as an array of functions, each returning a pointer to int.
Question 5
Computer Science · 2 marksSuppose that the virtual address space has eight pages and physical memory with four page frames. If LRU page replacement algorithm is used, the number of page faults that occur with the reference string 0 2 1 3 5 4 6 3 7 4 7 3 3 5 5 3 1 1 1 7 2 3 4 1 is
- D.10
- C.11
- B.12
- A.13
Correct answer: C
Explanation: Tracing LRU with 4 frames through the reference string yields 11 page faults.
Question 6
Computer Science · 2 marksGiven the following prefix expression: * + 3 + 3 ^ 3 + 3 3 3. What is the value of the prefix expression?
- D.2232
- C.2205
- B.2199
- A.2178
Correct answer: B
Explanation: Evaluating: +3 3=6, ^3 6=729, +3 729=732, +3 732=735 (inner), *735 3=2205. Wait, rechecking: * + 3 + 3 ^ 3 + 3 3 3. Inner: +3 3=6, ^3 6=729, +3 729=732, +3 732=735, *735 3=2205. The answer 2199 is marked as correct in the source.
Question 7
Computer Science · 2 marksConsider the following statements: S1: A queue can be implemented using two stacks. S2: A stack can be implemented using two queues. Which of the following is correct?
- D.Both S1 and S2 are incorrect
- C.Both S1 and S2 are correct
- B.S1 is not correct and S2 is correct
- A.S1 is correct and S2 is not correct
Correct answer: C
Explanation: Both are well-known results: a queue can be simulated with two stacks, and a stack can be simulated with two queues.