Computer Science Previous Year Questions (page 10)
570 Computer Science questions asked in UGC NET previous year papers, each with the correct answer and explanation. Read them free on UTpaper, or attempt the full papers as timed online tests.
Q451UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Which of the following cannot be passed to a function in C++?
AConstant
BStructure
CArray
DHeader file
Show answerHide answer
Correct answer: (D) Header file
Explanation
A header file cannot be passed to a function in C++, while a constant, a structure and an array can be passed to a function.
Q452UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Which one of the following is correct for overloaded functions in C++?
ACompiler sets up a separate function for every definition of function
BCompiler does not set up a separate function for every definition of function
COverloaded functions cannot handle different types of objects
DOverloaded functions cannot have same number of arguments
Show answerHide answer
Correct answer: (A) Compiler sets up a separate function for every definition of function
Explanation
When you call an overloaded function, the compiler determines the most appropriate definition to use by comparing the arguments types you used to call the function with the parameter types specified in the definitions. The process of selecting the most appropriate overloaded function is called overload resolution.
Q453UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
The general configuration of the micro programmed control unit is given below :
(Diagram: External Conditions → Next Address Generator → B → C, with 'Next Address Information' fed back from C to the Next Address Generator.)
What are blocks B and C in the diagram respectively?
ABlock address register and cache memory
BControl address register and control memory
CBranch register and cache memory
DControl address register and random access memory
Show answerHide answer
Correct answer: (B) Control address register and control memory
Explanation
In a microprogrammed control unit, the next address generator (sequencer) supplies the address to the control address register (B), which addresses the control memory (C); the control word read from control memory supplies the next address information. So B is the control address register and C is the control memory.
Q454UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
In 8085 microprocessor, the digit 5 indicates that the microprocessor needs
A–5 volts, +5 volts supply
B+5 volts supply only
C–5 volts supply only
D5 MHz clock
Show answerHide answer
Correct answer: (B) +5 volts supply only
Explanation
The '5' in 8085 indicates that it uses a single +5 V power supply (by using depletion-mode transistors), rather than the +5 V, –5 V and +12 V supplies needed by the 8080. Its clock speed is 3 MHz.
Q455UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
In 8085, which of the following performs : load register pair immediate operation?
ALDAS rp
BLHLD addr
CLXI rp, data
DINS rp
Show answerHide answer
Correct answer: (C) LXI rp, data
Explanation
LXI rp, data (load register pair immediate) loads a register pair with 2 bytes of immediate data. It is generally used to load SP or a memory pointer; the pairs used are H-L, D-E and B-C, where B, D, H hold the MSB and C, E, L hold the LSB.
Q456UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Any decision tree that sorts n elements has height ..............
AΩ(lg n)
BΩ(n)
CΩ(n lg n)
DΩ (n²)
Show answerHide answer
Correct answer: (C) Ω(n lg n)
Explanation
A binary tree of height h has at most 2ʰ leaves. Sorting n elements requires at least n! leaves, so n! ≤ 2ʰ, giving h ≥ lg(n!) ≥ (n/2) lg(n/2) = Ω(n lg n).
Q457UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Red–black trees are one of many search tree schemes that are "balanced" in order to guarantee that basic dynamic-set operations take .............. time in the worst case.
AO(1)
BO(lg n)
CO(n)
DO(n lg n)
Show answerHide answer
Correct answer: (B) O(lg n)
Explanation
Red-black trees are one of many search tree schemes that are 'balanced' in order to guarantee that basic dynamic-set operations take O(lg n) time in the worst case.
Q458UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Dijkstra's algorithm is based on
ADivide and conquer paradigm
BDynamic programming
CGreedy Approach
DBacktracking paradigm
Show answerHide answer
Correct answer: (C) Greedy Approach
Explanation
Dijkstra's algorithm always chooses the closest vertex in V – S to add to the set S, where S is the set of vertices whose final shortest-path weights from the source are known. So it is a greedy algorithm.
Q459UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
With respect to a loop in the transportation table, which one of the following is not correct?
AEvery loop has an odd no. of cells and atleast 5.
BClosed loops may or may not be square in shape
CAll the cells in the loop that have a plus or minus sign, except the starting cell, must be occupied cells
DEvery loop has an even no. of cells and atleast four.
Show answerHide answer
Correct answer: (A) Every loop has an odd no. of cells and atleast 5.
Explanation
In transportation table: (i) An even number of atleast 4 cells must participate in closed loop and an occupied cell can be considered only once and not more. (ii) Closed loop may or may not be square or rectangle in shape. (iii) All cells in the loop that have a plus or minus sign, except the starting cell, must be occupied.
Q460UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Which of the following are not regular?
(A) Strings of even number of a's
(B) Strings of a's, whose length is a prime number
(C) Set of all palindromes made up of a's and b's
(D) Strings of a's whose length is a perfect square
A(A) and (B) only
B(A), (B) and (C) only
C(B), (C) and (D) only
D(B) and (D) only
Show answerHide answer
Correct answer: (C) (B), (C) and (D) only
Explanation
(A) Strings with an even number of a's is regular, since a finite automaton can accept it. (B) Strings of a's whose length is prime, (C) palindromes over {a, b} and (D) strings of a's whose length is a perfect square are not regular: no finite automaton can accept them (provable with the pumping lemma).
Q461UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Abstraction and encapsulation are fundamental principles that underlie the object oriented approach to software development. What can you say about the following two statements?
I. Abstraction allows us to focus on what something does without considering the complexities of how it works.
II. Encapsulation allows us to consider complex ideas while ignoring irrelevant detail that would confuse us.
ANeither I nor II is correct
BBoth I and II are correct
COnly II is correct
DOnly I is correct
Show answerHide answer
Correct answer: (A) Neither I nor II is correct
Explanation
The book's solution: encapsulation allows us to focus on what something does without considering the complexities of how it works, and abstraction allows us to consider complex ideas while ignoring irrelevant details that would confuse us. Hence, as per the book, neither statement is correct.
Q462UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Which of the following statements(s) with regard to an abstract class in JAVA is/are TRUE?
I. An abstract class is one that is not used to create objects.
II. An abstract class is designed only to act as a base class to be inherited by other classes.
AOnly I
BOnly II
CNeither I nor II
DBoth I and II
Show answerHide answer
Correct answer: (D) Both I and II
Explanation
A class declared abstract cannot be instantiated; it must be extended and its methods implemented. It is designed only to act as a base class to be inherited by other classes. So both I and II are true.
Q463UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Given the following statements :
(A) A class of language that is closed under union and complementation has to be closed under intersection
(B) A class of language that is closed under union and intersection has to be closed under complementation
Which of the following options is correct?
ABoth (A) and (B) are false
BBoth (A) and (B) are true
C(A) is true, (B) is false
D(A) is false, (B) is true
Show answerHide answer
Correct answer: (C) (A) is true, (B) is false
Explanation
(A) is true by De Morgan's law: A ∩ B = (A' ∪ B')'. (B) is false: recursively enumerable languages are closed under union and intersection but not under complementation.
Q464UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Consider the following JAVA program :
public class First {
public static int CBSE (int x) {
if (x < 100) x = CBSE (x + 10)
return (x – 1)
}
public static void main (String [ ] args) {
system. out. print (First. CBSE (60));
}
What does this program print ?
A59
B95
C69
D99
Show answerHide answer
Correct answer: (B) 95
Explanation
CBSE(60) → CBSE(70) → CBSE(80) → CBSE(90) → CBSE(100). CBSE(100) returns 99; then CBSE(90) returns 98, CBSE(80) returns 97, CBSE(70) returns 96 and CBSE(60) returns 95. So the program prints 95.
Q465UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Given the array of integers 'array' shown below :
13 7 27 2 18 33 9 11 22 8
What is the output of the following Java statements?
int [ ] p = new int [10];
int [ ] q = new int [10];
for (ink k = 0; k < 10; k++)
p[k] = array [k];
q = p;
p[4] = 20;
System out. println (array [4]+ "." + q[4]);
A20 : 20
B18 : 18
C18 : 20
D20 : 18
Show answerHide answer
Correct answer: (C) 18 : 20
Explanation
The loop copies all values of 'array' into p. After q = p, q refers to the same array object as p, so p[4] = 20 also makes q[4] = 20. 'array' itself is unchanged, so array[4] = 18. The output is 18 : 20.
Q466UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Names of some of the Operating systems are given below :
(A) MS–DOS
(B) XENIX
(C) OS/2
In the above list, following operating systems didn't provide multi-user facility.
A(A) only
B(A) and (B) only
C(B) and (C) only
D(A), (B) and (C)
Show answerHide answer
Correct answer: (D) (A), (B) and (C)
Explanation
(i) MS-DOS was a single-user operating system. (ii) XENIX has always been multi-user. (iii) OS/2 does not provide a multi-user facility. The book's key is (d): (A), (B) and (C).
Q467UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
A memory management system has 64 pages with 512 bytes page size. Physical memory consists of 32 page frames. Number of bits required in logical and physical address are respectively :
A14 and 15
B14 and 29
C15 and 14
D16 and 32
Show answerHide answer
Correct answer: (C) 15 and 14
Explanation
Logical address space = number of pages × page size = 2⁶ × 2⁹ = 2¹⁵, so the logical address needs 15 bits. Physical address space = number of frames × page size = 2⁵ × 2⁹ = 2¹⁴, so the physical address needs 14 bits.
Q468UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Some of the criteria for calculation of priority of a process are :
A. Processor utilization by an individual process
B. Weight assigned to a user or group of users
C. Processor utilization by a user or group of processes
In fair share scheduler, priority is calculated based on :
AOnly (A) and (B)
BOnly (A) and (C)
C(A), (B), and (C)
DOnly (B) and (C)
Show answerHide answer
Correct answer: (C) (A), (B), and (C)
Explanation
Fair-share scheduling is a scheduling algorithm in which CPU usage is equally distributed among system users or groups, rather than equally among processes. The priority considers processor utilization by the individual process, by the user or group, and the weight assigned to the user or group, so (A), (B) and (C).
Q469UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
One of the disadvantages of user level threads compared to Kernel level threads is
AIf a user level thread of a process executes a system call, all threads in that process are blocked
DThe library procedures invoked for thread management in user level threads are local procedures
Show answerHide answer
Correct answer: (A) If a user level thread of a process executes a system call, all threads in that process are blocked
Explanation
User level threads – advantages: thread switching does not require kernel mode privileges; they can run on any OS; they are fast to create and manage. Disadvantages: in a typical OS most system calls are blocking, so if one user level thread executes a system call, all threads of that process are blocked; and a multithreaded application cannot take advantage of multiprocessing.
Q470UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Which statements is not correct about "init" process in Unix?
AIt is generally the parent of the login shell
BIt has PID 1.
CIt is the first process in the system.
DInit forks and execs a 'getty' process at every port connected to a terminal.
Show answerHide answer
Correct answer: (C) It is the first process in the system.
Explanation
'init' (PID 1) is not the first process in the system; it is the second, since the scheduler/swapper process (PID 0) is created first. So statement (c) is not correct.
Q471UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Which of the following is an interrupt according to temporal relationship with system clock?
AMaskable interrupt
BPeriodic interrupt
CDivision by zero
DSynchronous interrupt
Show answerHide answer
Correct answer: (D) Synchronous interrupt
Explanation
A synchronous interrupt is one whose source is in phase with the system clock, i.e. interrupts that depend on the system clock (example: a time service that uses the system clock).
Q472UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Which of the following is incorrect for virtual memory?
ALarge programs can be written
BMore I/O is required
CMore addressable memory available
DFaster and easy swapping of process
Show answerHide answer
Correct answer: (B) More I/O is required
Explanation
Virtual memory maps the virtual addresses used by a program into physical addresses. It provides more addressable memory, allows programs larger than physical memory to run, and allows easy swapping; it does not require more I/O. So 'More I/O is required' is incorrect.
Q473UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
For a database relation R(A, B, C, D) where the domains of A, B and D include only atomic values, only the following functional dependencies and those that can be inferred from them are :
A → C
B → D
The relation R is in ______
AFirst normal form but not in second normal form
BBoth in first normal form as well in second normal form
CSecond normal form but not in third normal form
DBoth in second normal form as well in third normal form
Show answerHide answer
Correct answer: (A) First normal form but not in second normal form
Explanation
No single attribute determines all others. The closure {AB}⁺ = {A, B, C, D}, so AB is the only candidate key. 2NF requires non-prime attributes to be fully dependent on the key, but C depends on A alone and D on B alone (partial dependencies). So R is in 1NF but not in 2NF.
Q474UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Consider the following relation :
Works (emp_name, company_name, salary)
Here, emp_name is primary key.
Consider the following SQL query
Select emp_name
From works T
where salary > (select avg (salary)
from works S
where T.company_name = S.company_name)
The above query if for following :
AFind the highest paid employee who earns more than the average salary of all employees of his company
BFind the highest paid employee who earns more than the average salary of all the employees of all companies
CFind all employees who earn more than the average salary of all employees of all the companies
DFind all employees who earn more than the average salary of all employees of their company
Show answerHide answer
Correct answer: (D) Find all employees who earn more than the average salary of all employees of their company
Explanation
The correlated subquery computes the average salary of the employee's own company (T.company_name = S.company_name). The query does not use max, so it does not select only the highest paid employee; it selects all employees who earn more than the average salary of their company.
Q475UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Super key: a set of attributes that uniquely identifies a tuple. Candidate key: a minimal super key (no proper subset is a super key). Primary key: the candidate key chosen to identify tuples. So Primary key ⊆ candidate key ⊆ super key.
Q476UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Which of the following statements(s) is/are TRUE with regard to software testing?
I. Regression testing technique ensures that the software product runs correctly after the changes during maintenance.
II. Equivalence partitioning is a white-box testing technique that divides the input domain of a program into classes of data from which test cases can be derived.
AOnly I
BOnly II
CBoth I and II
DNeither I nor II
Show answerHide answer
Correct answer: (A) Only I
Explanation
Regression testing verifies that previously developed and tested software still performs correctly after it is changed, so I is true. Equivalence partitioning is a black-box (not white-box) testing method, so II is false.
Q477UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Which of the following are facts about a top-down software testing approach?
I. Top-down testing typically requires the tester to build method stubs.
II. Top-down testing typically requires the tester to build test drivers.
AOnly I
BOnly II
CBoth I and II
DNeither I nor II
Show answerHide answer
Correct answer: (A) Only I
Explanation
Top-down testing proceeds from the main module to sub-modules; a sub-module not yet developed is simulated by a temporary program called a STUB. Bottom-up testing proceeds from sub-modules to the main module, using DRIVERS to simulate the main module. So only I is true.
Q478UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Which of the following HTML code will affect the vertical alignment of the table content?
A<td style = "vertical-align : middle" > Text Here </td>
B<td valign = "centre"> Text Here </td>
C<td style = "text-align : center"> Text Here </td>
D<td align = "middle" > Text Here </td>
Show answerHide answer
Correct answer: (B) <td valign = "centre"> Text Here </td>
Explanation
Vertical alignment of table contents is set by <td valign = 'top | middle | bottom | baseline'> Text here </td>. No option matches exactly; taking 'centre' as middle, option (b) matches.
Q479UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
What can you say about the following statements?
I. XML tags are case-insensitive
II. In Java Script, identifier names are case-sensitive.
III. Cascading Style Sheets (CSS) cannot be used with XML.
IV. All well-formed XML documents must contain a document type definition.
AOnly I and II are false
BOnly III and IV are false
COnly I and III are false
DOnly II and IV are false
Show answerHide answer
Correct answer: (D) Only II and IV are false
Explanation
I is false: XML tags are case-sensitive. II is true: JavaScript identifiers are case-sensitive. III is false: CSS can be applied to any XML document. IV is false: a well-formed XML document does not need a DTD. (The book keys option (d).)
Q480UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
A segment is any object described by GKS commands and data that start with CREATE SEGMENT and Terminates with CLOSE SEGMENT command. What function can be performed on these segments?
ATranslation and Rotation
BPanning and Zooming
CScaling and Shearing
DTranslation, Rotation, Panning and Zooming
Show answerHide answer
Correct answer: (D) Translation, Rotation, Panning and Zooming
Explanation
A GKS segment is any object described by GKS commands and data that start with CREATE SEGMENT and terminate with CLOSE SEGMENT. Segments allow objects to be manipulated by simply referring to the segment number, so segments can be translated, rotated, panned and zoomed.
Q481UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Which of the following neural networks uses supervised learning?
(A) Multilayer perceptron
(B) Self organizing feature map
(C) Hopfield network
A(A) only
B(B) only
C(A) and (B) only
D(A) and (C) only
Show answerHide answer
Correct answer: (A) (A) only
Explanation
Multilayer perceptron network and support vector machines are examples of supervised learning, while self organizing feature maps and Hopfield networks are examples of unsupervised learning.
Q482UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Consider following two rules R1 and R2 in logical reasoning in Artificial Intelligence (AI):
R1 : from α ⊃ β and α infer β is known as Modus Tollens (MT)
R2 : From α ⊃ β and ¬α infer ¬β is known as Modus Ponens (MP)
AOnly R1 is correct
BOnly R2 is correct
CBoth R1 and R2 are correct
DNeither R1 nor R2 is correct
Show answerHide answer
Correct answer: (D) Neither R1 nor R2 is correct
Explanation
From α ⊃ β and α infer β is Modus Ponens (not Modus Tollens), and Modus Tollens infers ¬α from α ⊃ β and ¬β. R2 is not Modus Ponens either. So neither R1 nor R2 is correct.
Q483UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
In Artificial Intelligence (AI), what is present in the planning graph?
ASequence of levels
BLiterals
CVariables
DHeuristic estimates
Show answerHide answer
Correct answer: (A) Sequence of levels
Explanation
A planning graph consists of a sequence of levels that correspond to time steps in the plan; level 0 is the initial state. Each level contains a set of literals (all that could be true at that time step) and a set of actions (all whose preconditions could be satisfied at that step). It is used to obtain heuristic estimates, and a solution can be extracted using GRAPHPLAN.
Q484UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
What is the best method to go for the game playing problem?
AOptimal search
BRandom search
CHeuristic search
DStratified search
Show answerHide answer
Correct answer: (C) Heuristic search
Explanation
Game playing uses heuristic search, since brute-force computation over hundreds of thousands of positions is not practical.
Q485UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)
Which of the following pairs have different expressive power?
ASingle-tape-turing machine and multi-dimensional turing machine
BMulti-tape turing machine and multi-dimensional turing machine
CDeterministic push down automata and non-deterministic pushdown automata.
DDeterministic finite automata and Non-deterministic finite automata
Show answerHide answer
Correct answer: (C) Deterministic push down automata and non-deterministic pushdown automata.
Explanation
Deterministic and non-deterministic pushdown automata have different expressive power (NPDA accept all context-free languages, DPDA only deterministic CFLs). DFA and NFA are equivalent, and all the Turing machine variants are equivalent.
Q486UGC NET Computer Science, November 2017 (Paper II & III, Selected Questions)
The Octal equivalent of the binary number 1011101011 is :
A7353
B1353
C5651
D5657
Show answerHide answer
Correct answer: (B) 1353
Explanation
Group the bits in threes from the right: 001 011 101 011. 001 = 1, 011 = 3, 101 = 5, 011 = 3. So (1011101011)₂ = (1353)₈.
Q487UGC NET Computer Science, November 2017 (Paper II & III, Selected Questions)
Let m = (313)₄ and n = (322)₄. Find three base 4 expansion of m + n.
A(635)₄
B(32312)₄
C(21323)₄
D(1301)₄
Show answerHide answer
Correct answer: (D) (1301)₄
Explanation
Convert both numbers to decimal, add, and convert back to base 4: (313)₄ = 3×4² + 1×4¹ + 3×4⁰ = 55; (322)₄ = 3×4² + 2×4¹ + 2×4⁰ = 58. 55 + 58 = 113, and 113 in base 4 is (1301)₄.
Q488UGC NET Computer Science, November 2017 (Paper II & III, Selected Questions)
The Boolean function with the Karnaugh map
(rows CD, columns AB in order 00, 01, 11, 10)
CD = 00: 0 1 1 0
CD = 01: 0 1 1 1
CD = 11: 1 1 1 1
CD = 10: 0 1 1 0
A(A + C) . D + B
B(A + B) . C + D
C(A + D) . C + B
D(A + C) . B + D
Show answerHide answer
Correct answer: (A) (A + C) . D + B
Explanation
Grouping the 1s: columns AB = 01 and 11 give B, the row CD = 11 together with the cell AB = 10, CD = 01 give CD and AD. SOP form = AD + CD + B = (A + C).D + B.
Q489UGC NET Computer Science, November 2017 (Paper II & III, Selected Questions)
Let A =
[1 0 0]
[0 1 0]
[1 1 0]
[0 0 1]
and B =
[1 1 1 0]
[0 1 1 0]
[1 0 1 1]
Find the Boolean product A ⊙ B of the two matrices.
In the Boolean product, multiplication is replaced by logical AND and addition by logical OR. Row i of A ⊙ B is the OR of the rows of B selected by the 1s in row i of A: row 1 = B1 = 1110, row 2 = B2 = 0110, row 3 = B1 ∨ B2 = 1110, row 4 = B3 = 1011. So option (a) is correct.
Q490UGC NET Computer Science, November 2017 (Paper II & III, Selected Questions)
Let P and Q be two propositions, ¬ (P ↔ Q) is equivalent to :
AP ↔ ¬Q
B¬ P ↔Q
C¬ P ↔ ¬ Q
DQ → P
Show answerHide answer
Correct answer: (A) P ↔ ¬Q
Explanation
P ↔ Q = P'Q' + PQ, so ¬(P ↔ Q) = P'Q + PQ', which is true exactly when P and Q differ. This is the same as P ↔ ¬Q (and ¬P ↔ Q).
Q491UGC NET Computer Science, November 2017 (Paper II & III, Selected Questions)
Q492UGC NET Computer Science, November 2017 (Paper II & III, Selected Questions)
If the time is now 4 O'clock, what will be the time after 101 hours from now?
A9 O'clock
B8 O'clock
C5 O'clock
D4 O'clock
Show answerHide answer
Correct answer: (A) 9 O'clock
Explanation
The clock repeats every 12 hours. 101 mod 12 = 5, so the time after 101 hours = 4 + 5 = 9 O'clock.
Q493UGC NET Computer Science, November 2017 (Paper II & III, Selected Questions)
How many distinguishable permutations of the letters in the word BANANA are there?
A720
B120
C60
D360
Show answerHide answer
Correct answer: (C) 60
Explanation
The number of permutations of n objects with n₁, n₂, ..., nₖ identical objects of each type is n!/(n₁! n₂! ... nₖ!). BANANA has 6 letters with A three times, N twice and B once: 6!/(3! 2! 1!) = 60.
Q494UGC NET Computer Science, November 2017 (Paper II & III, Selected Questions)
Consider the following program fragment in assembly language :
mov ax, 0h
mov cx, 0A, h
doloop :
dec ax
loop doloop
What is the value of ax and cx registers after the completion of the doloop?
Aax = FFF5 h and cx = 0 h
Bax = FFF6 h and cx = 0 h
Cax = FFF7 h and cx = 0A h
Dax = FFF5 and cx = 0A h
Show answerHide answer
Correct answer: (B) ax = FFF6 h and cx = 0 h
Explanation
cx = 0Ah = 10, so the loop body runs 10 times; loop decrements cx and stops when cx = 0h. ax starts at 0 and is decremented 10 times: 0 − 10 = FFF6h (16-bit two's complement). So ax = FFF6h and cx = 0h.
Q495UGC NET Computer Science, November 2017 (Paper II & III, Selected Questions)
Consider the following assembly program fragment :
stc
mov al, 110101110b
mov cl, 2
rcl al, 3
rol al, 4
shr al, cl
mul cl
The contents of the destination register ax (in hexadecimal) and the status of Carry Flag (CF) after the execution of above instructions, are :
Aax = 003CH; CF = 0
Bax = 001EH; CF = 0
Cax = 007BH; CF = 1
Dax = 00B7H; CF = 1
Show answerHide answer
Correct answer: (A) ax = 003CH; CF = 0
Explanation
After the rotate and shift instructions al = 00011110, and mul cl multiplies it by 2 (append a 0 bit at the LSB): ax = 0000000000111100 = 003CH. For mul, CF = 0 when the high byte of the result is 0 and CF = 1 otherwise; here the high byte is 0, so CF = 0. Hence ax = 003CH; CF = 0.
Q496UGC NET Computer Science, November 2017 (Paper II & III, Selected Questions)
Which speed up could be achieved according to Amdahl's law of infinite number of processes if 5% of a program is sequential and the remaining part is ideally parallel?
AInfinite
B5
C20
D50
Show answerHide answer
Correct answer: (C) 20
Explanation
Sequential part = 5% = 0.05, parallel part = 0.95. By Amdahl's law with an infinite number of processors, speed up S = 1 / (1 − 0.95) = 1 / 0.05 = 20.
Q497UGC NET Computer Science, November 2017 (Paper II & III, Selected Questions)
Post order traversal of a given binary search tree T produces following sequence of keys : Which one of the following sequences of keys can be the result of an in-order traversal of the tree T?
An in-order traversal of a binary search tree always gives the keys in ascending order, so the in-order sequence is 3, 4, 5, 7, 9, 14, 15, 16, 17, 18, 20.
Q498UGC NET Computer Science, November 2017 (Paper II & III, Selected Questions)
The following numbers are inserted into an empty binary search tree in the given order : 10, 1, 3, 5, 15, 12, 16. What is the height of the binary search tree?
A3
B4
C5
D6
Show answerHide answer
Correct answer: (A) 3
Explanation
Inserting 10, 1, 3, 5, 15, 12, 16: 10 is the root; 1 is its left child, 3 is the right child of 1 and 5 is the right child of 3; 15 is the right child of 10 with children 12 and 16. The longest root-to-leaf path is 10-1-3-5 with 3 edges, so the height is 3.
Q499UGC NET Computer Science, November 2017 (Paper II & III, Selected Questions)
A list of n strings, each of length n, is sorted into lexicographic order using merge - sort algorithm. The worst case running time of this computation is :
AO(n log n)
BO(n² log n)
CO(n² + log n)
DO(n³)
Show answerHide answer
Correct answer: (B) O(n² log n)
Explanation
Merge sort performs O(n log n) comparisons, and comparing two strings of length n takes O(n) time in the worst case. So the worst-case running time is O(n · n log n) = O(n² log n).
Q500UGC NET Computer Science, November 2017 (Paper II & III, Selected Questions)
Consider an array representation an n element binary heap where the elements are stored from index 1 to index n of the array. For the element stored at index i of the array (i < = n), the index of the parent is :
Afloor ((i + 1)/2)
Bceiling ((i + 1)/2)
Cfloor (i/2)
Dceiling (i/2)
Show answerHide answer
Correct answer: (C) floor (i/2)
Explanation
In a binary heap stored in an array from index 1 to n, the children of index i are at 2i and 2i + 1, so the parent of the element at index i is at floor(i/2).
How to use these UGC NET Computer Science questions
Every question here was asked in a real UGC NET paper; the paper and shift are shown on the card, and the number opens the question on its own page. Try each one before tapping Show answer, then attempt the full UGC NET papers as timed tests to check your speed under exam conditions.