U.G.C. NET Exam. 4 December, 2019 Paper II (COMPUTER SCIENCE & APPLICATIONS)

Total Questions: 100

31. Which of the following methods are used to pass any number of parameters to the operating system through system calls?

Correct Answer: (d) Block in main memory and stack
Solution:

Following are the methods used to pass parameters to the OS.
1-Registers : Parameters are passed via registers but the limitation of this method is that the number of parameters cannot exceed the number of register.
2-Blocks : when there are more parameters than registers, these parameters are stored on a main memory block and the pointer to this block (block address) is passed as a parameter to a register.
3-Stack : Parameter can also be pushed on and popped off the stack by the OS. This method can be used when we don't certainly know the number of parameters be forehand. Therefore, methods used to pass ANY NUMBER of parameters to the operating system through system calls are via block and stack. Register cannot pass. ANY NUMBER of parameters.

32. Java Virtual Machine (JVM) is used to execute architectural neutral byte. Which of the following is needed by the JVM for execution of Java Code?

Correct Answer: (b) Class loader and Java Interpreter
Solution:

Java virtual machine is component of technology for its hardware and operating system independence, the small size of its compiled code and its ability to protect users from malicious programs. Java virtual machine is an abstract computing machine, like a real computing machine, it has an instructions set and manipulated various memory areas at run time.
* Java virtual machine knows nothing of java Programming language, only of a particular binary format the class file format.
* A class file contains JVM instructions or byte codes and a symbol table as well as other information.
* JVM imposes strong syntactical and structural constraints on code in a class file
* Class loader and interpreter is needed by JVM to execute Java code
* Basic structure in JVM are : heap store, stack, method area, runtime constant pools, PC

33. In a system for a restaurant, the main scenario for placing order is given below :

(a) Customer reads menu
(b) Customer places order
(c) Order is sent to kitchen for preparation
(d) Ordered items are served
(e) Customer requests for a bill for the order
(f) Bill is prepared for this order
(g) Customer is given the bill
(h) Customer pays the bill
A sequence diagram for the scenario will have atleast how many objects among whom the messages will be exchanged .

Correct Answer: (c) 5
Solution:

There are five objects among whom the message will be exchanged. :
These are :
1. Customer
2. Person who takes the order
3. Chef
4. Serving person
5. Cashier
Process with the help of diagram is :

34. An ______ chart is a project schedule representation that presents project plan as a directed graph. The critical path is the _______ sequence of _______ tasks and it defines project ________.

Correct Answer: (b) Activity, Longest, Dependent, Duration
Solution:

CPM (critical path method) models the activities and events of a project as a network. Activities are identified as nodes and events that signify the start and end of activities are denoted as edges between nodes.
CPM provides a graphical view of the project. It predicts the time required to complete the project.
* Main aim of CPM is to determine the minimum completion time for a project.
* It uses forward and backward pas routines to analyze the project network.
* If monitors the progress of project on basis of network schedule.
* In CPM, critical path is the longest sequence of dependent tasks and it defines project duration.
* During forward pass, it is assumed that each activity will begin at its earlies stunting time.
* During backward pass, it is assumed that each activity begins at its latest completion time. Steps of CPM project planning :
1. Specification of individual activities and determining the sequence of those activities.
2. Then draw network diagram as directed graph.
3. Estimation of completion time for each activity.
4. Then identity the critical path or longest path through the network.
5. Finally update the CPM as the project progresses.

35. Answer the following question

Correct Answer: (a) 160
Solution:


≡ 7(103) mod 561
≡ 721 mod 561
≡ 160

36. A clique in an undirected graph G = V ,E is a subset V' ⊆ V of vertices, such that

Correct Answer: (c) Each pair of vertices in V' is connected by an edge
Solution:

A clique is a subset of vertices of an undirected graph G such that every two distinct vertices in the clique are adjacent
A clique in an undirected graph G = (V, E) is a subset of V i.e. V' such that each pair of vertices in V' is connected by an edge A clique of size k is called kclique A o – clique contains set of o vertices. A maximal clique is a clique that cannot be extended by including one more adjacent vertex. A maximum clique of G is such that there is no clique with more vertices.
3 cliques :
1 – 2 – 3
2 – 3 – 4
2 – 3 – 6
2 – 4 – 6
3 – 4 – 6
A Graph with 5 cliques of size 3

37. What is the worst case running time of Insert and Extract-min, in an implementation of a priority queue using an unsorted array? Assume that all insertions can be accommodated.

Correct Answer: (a) θ(1) , θ(n)
Solution:

A priority queue is a queue in which each element is assigned a priority and they are served according to the priority. If element having same priority, they are processes according to their order in queue. Insert, extract – min is performed on unsorted array.
Insert : It means insertion of element in unsorted array. In the worst case, element is inserted at the end of the queue. Simply inserting the element at the end of queue takes 0(1) complexity.
Extract-min : To do extract-min, use linear search approach for worst case to find the minimum element. For this, we need to traverse all the elements of the queue in worst case. So it will take 0(n) time complexity to extract - min in priority queue.

38. In a B-Tree, each node represents a disk block. Suppose one block holds 8192 bytes. Each key uses 32 bytes. In a B-tree of order M there are M - 1 keys. Since each branch is on another disk block, we assume a branch is of 4 bytes. The total memory requirement for a non-leaf node is

Correct Answer: (b) 36 M - 32
Solution:

39. Answer the following question

Correct Answer: (c)
Solution:

40. Consider a weighted directed graph. The current shortest distance from source S to node x is represented by d[x]. Let d[v] = 29, d[u] = 15, w[u , v] = 12. What is the updated value of d[v] based on current information?

Correct Answer: (d) 17
Solution:

If d represents the length of the path, then : d(v)