All 100 questions of DSSSB TGT Computer Science Practice Set 4 with the correct answer and a solution. Read them free on UTpaper, or attempt the paper as a timed online test.
The concatenation of two lists is to be performed in O(1) time. Which of the following implementations of lists could be used?
ASingly linked list
BDoubly linked list
CCircular doubly linked list
DArray implementation of list
Show answerHide answer
Correct answer: (C) Circular doubly linked list
Explanation
In a circular doubly linked list the last node is reached directly through head->prev. So two lists can be joined by changing a few pointers in O(1) time, without traversing.
Match List-I with List-II and select the correct answer using the codes given below the Lists:
List-I
A. All-pairs shortest path
B. Quicksort
C. Minimum weight spanning tree
D. Connected components
List-II
1. Greedy
2. Depth-first search
3. Dynamic programming
4. Divide and conquer
Codes: A B C D
A2 4 1 3
B3 4 1 2
C3 4 2 1
D4 1 2 3
Show answerHide answer
Correct answer: (B) 3 4 1 2
Explanation
All-pairs shortest path (Floyd-Warshall) uses dynamic programming, quicksort uses divide and conquer, minimum spanning tree (Prim/Kruskal) is greedy, and connected components are found with DFS. That gives 3, 4, 1, 2.
Which of the following algorithms solves the all-pairs shortest path problem?
ADijkstra's algorithm
BFloyd's algorithm
CPrim's algorithm
DWarshall's algorithm
Show answerHide answer
Correct answer: (B) Floyd's algorithm
Explanation
Floyd's (Floyd-Warshall) algorithm finds shortest paths between every pair of vertices in O(V³). Dijkstra is single-source, Prim builds an MST, and Warshall finds transitive closure.
Conceptual level, Internal level and External level are three components of the three- level RDBMS architecture. Which of the following is not part of the conceptual level?
AStorage dependent details
BEntities, attributes, relationships
CConstraints
DSemantic information
Show answerHide answer
Correct answer: (A) Storage dependent details
Explanation
Storage-dependent details such as file organisation and indexes belong to the internal (physical) level. The conceptual level describes entities, attributes, relationships, constraints and semantics.
Which of the following statements best describes the main reasons for normalizing relational database?
I. To Achieve physical data independence.
II. To remove data anomalies (insertion. update, deletion, anomalies).
III. To save space on disk.
AI, II and III
BI and II only
CI and III only
DII and III only
Show answerHide answer
Correct answer: (D) II and III only
Explanation
Normalization removes redundancy, which prevents insert, update and delete anomalies and saves storage space. It does not provide physical data independence, which comes from the three-level architecture.
A thread is called a lightweight process. Threads of the same process share its code, data and files, so creating and switching between them costs little.
Consider a set of n tasks with known runtimes r1, r2 ........ rn, to be run on a uniprocessor machine, Which of the following processor scheduling algorithm will result in the maximum throughput.
APriority scheduling
BRound-robin
CFCFS
DShortest job first
Show answerHide answer
Correct answer: (D) Shortest job first
Explanation
Shortest Job First runs the shortest tasks first, so the most jobs finish in a given time. It gives maximum throughput and minimum average waiting time.
Dictionary keys must be unique. The second 10 overwrites the first value but keeps the key's original position, giving {10: 'Decimal', 100: 'Hundred'}.
Which approach of learning out of the following, engages participants in activity, leads them to reflect on their activity critically and obtain useful insight and learning?
ACollaboration
BPassive learning
CObservation
DExperiential learing
Show answerHide answer
Correct answer: (D) Experiential learing
Explanation
Experiential learning (Kolb) is learning by doing: learners take part in an activity, reflect on it critically, and draw insights they can apply.
Intellectual Property Rights (IPR) protect the use of information and ideas that are of:
ATraditional value
BHistorical value
CCommercial value
DEthical value
Show answerHide answer
Correct answer: (C) Commercial value
Explanation
IPR protects creations of the mind, such as inventions, designs and brands, that have commercial value, giving the creators exclusive rights to use them.
Which of the following operations have the highest level of precedence?
A( )
B+ −
C* /
D^ (exponentiation)
Show answerHide answer
Correct answer: (D) ^ (exponentiation)
Explanation
Among the arithmetic operators, exponentiation (^) has the highest precedence, above * and /, which are above + and −. Parentheses are grouping symbols, not operations.
Which topologies of networks is represented in the following diagram ?
Diagram: a main cable with two computers attached to it branches out into three separate cables (lines); each branch cable has several computers attached to it (4 on the upper branch, 5 on the middle branch, 3 on the lower branch).
ABUS
BRING
CSTAR
DTREE
Show answerHide answer
Correct answer: (D) TREE
Explanation
Several bus segments branch out from a main backbone cable, making a hierarchy of buses. This is a tree topology.
Identify the error in the following HTML code:
<HTML>
<BODY>
<FORM ID = "FORM1" METHOD = POST>
<BR> SELECT YOUR FAVOURITE CHANNEL :
NETFLIX <INPUT TYPE = CHECKSELECT>
AMAZON PRIME <INPUT TYPE = CHECKSELECT>
</FORM>
</BODY>
</HTML>
(a) NAME instead of ID and CHECKBOX instead of CHECKSELECT.
(b) METHOD = GET instead of POST.
AOnly (a) is correct
BBoth (a) and (b) are correct
COnly (b) is correct
DThe code is correct and has no errors
Show answerHide answer
Correct answer: (A) Only (a) is correct
Explanation
Form controls need a NAME attribute to be submitted, and the input type for tick boxes is CHECKBOX. CHECKSELECT does not exist. METHOD = POST is valid, so only (a) is correct.
Select the correct output of the following C++ program segment assuming all necessary header files are correctly included.
void main ()
{
char *S = "Inheritance";
S +=6 ;
cout<<S<< endl;
}
Aitence
Btance
CTence
DInheri
Show answerHide answer
Correct answer: (B) tance
Explanation
S points to "Inheritance". S += 6 moves it to index 6 (I0 n1 h2 e3 r4 i5 t6), so cout prints "tance".
This question is based on the following C++ code segment and class FUN : class FUN
class FUN
{
int CODE ;
public :
FUN ( ); //Function1
FUN (int C); //Function2
FUN (FUN & F); //Function3
void DISP ( ); //Function4
~FUN ( ); //Function5
};
void main ( )
{
FUN F1 ;
______ // BLANK
______
______}
Which of the following is an example of default constructor?
AFunction 1
BFunction 2
CFunction 3
DFunction 5
Show answerHide answer
Correct answer: (A) Function 1
Explanation
A default constructor takes no arguments, so FUN() (Function 1) is the default constructor. FUN(int) is parameterized, FUN(FUN&) is the copy constructor, and ~FUN() is the destructor.
Which of the following is depicted from the flowchart shown below?
Flowchart (top to bottom, one straight path): P=1000 → R=10 → T=2 → SI=P*R*T/100 → PRINT SI
ASequencing
BBranching
CLooping
DOverloading
Show answerHide answer
Correct answer: (A) Sequencing
Explanation
The flowchart runs straight from top to bottom with no decisions or loops, which is sequencing (sequential control flow).
Assume the values of X, Y and Z variables are assigned with values as −10, 20 and −30 respectively find out, which of following expression will evaluate to true ?
AX > Z and Y >= Z
BX > Y and X <= Z
CX >= Z and Z <= Y
DY <= X and Z <= Y
Show answerHide answer
Correct answer: (A) X > Z and Y >= Z
Explanation
Answer as per the book's key (a). Note that option (c) also evaluates to true for these values.
Which of the following search algorithm requires a sorted array ?
ALinear search
BHash search
CBinary search
DAll of these
Show answerHide answer
Correct answer: (C) Binary search
Explanation
Binary search repeatedly halves the search range by comparing with the middle element, which only works if the array is sorted. Linear search works on unsorted data.
With an IP address of 100, you currently have 80 subnets. What subnet mask should you use to maximize the number of available hosts ?
A192
B224
C248
D252
Show answerHide answer
Correct answer: (D) 252
Explanation
Note: the answer key gives (D) 252, but 252 adds only 6 subnet bits (64 subnets). 80 subnets need 7 bits (2⁷ = 128), which makes the octet 254 (255.254.0.0 for network 100). The question is garbled.
The diagram given below represents
Diagram: Processes enter a 'ready queue' which feeds the 'CPU'; an arrow leaves the CPU (exit). From the CPU, four paths lead back to the ready queue:
1. I/O request → I/O queue → I/O → back to ready queue
2. time slice expired → back to ready queue
3. fork a child → child executes → back to ready queue
4. wait for an interrupt → interrupt occurs → back to ready queue
AProcess creation
BProcess state
CQueuing diagram
DCommunication model
Show answerHide answer
Correct answer: (C) Queuing diagram
Explanation
The diagram shows the ready queue, the I/O queues and the events that move a process between them. This is the queueing diagram of process scheduling.
The figure below represents a
Figure: an arrow points to a root node R; R has two arrows going down, one to a triangle (subtree) labelled A on the left and one to a triangle (subtree) labelled B on the right.
ABinary tree
BRecursive tree
CInsert sort
DUnitary tree
Show answerHide answer
Correct answer: (A) Binary tree
Explanation
The figure shows a root with a left subtree A and a right subtree B. This is the recursive definition of a binary tree.
Consider the following statements :
S1 : a small page size causes large page tables,
S2 : internal fragmentation is increaseked with small pages.
S3 : I/O transfers are more efficient with large pages.
Which of the following is true?
AS1 is true and S3 is false
BS1 and S2 are true
CS2 and S3 are true
DS1 is true and S2 is false
Show answerHide answer
Correct answer: (D) S1 is true and S2 is false
Explanation
S1 is true, because small pages mean more pages and so bigger page tables. S2 is false, because small pages reduce internal fragmentation. S3 is true, because large pages make I/O more efficient. So the statement "S1 is true and S2 is false" holds.
Assume X and Y are non-zero positive integers. Consider the following pseudo-code fragment:
while X<>Y do
if X>Y then
X ← X−Y
else
Y ← Y−X
endif
end while
print (X)
What is the code doing?
AIt computes the GCD of two numbers.
BIt computes the LCM of two numbers.
CIt finds the smallest of two numbers.
DIt divides the largest number by the smaller.
Show answerHide answer
Correct answer: (A) It computes the GCD of two numbers.
Explanation
Subtracting the smaller number from the larger until both are equal is Euclid's subtraction method, so the final X is the GCD.
Which of the following is not a program control instruction ?
ACMP
BMOV
CJMP
DCALL
Show answerHide answer
Correct answer: (B) MOV
Explanation
MOV only transfers data. JMP and CALL change the flow of control, and CMP sets flags for conditional branching, so these are grouped with program control.
For a tree with just one node, the root node is the height of a binary tree is defined to zero; if there are 2 levels of nodes, the height is 1 and so on.
A Binary Search Tree is built according to the usual rules with the following six key inserted one at a time as given :
B, I, N, A, R, Y. What is the height of the tree?
A5
B2
C3
D4
Show answerHide answer
Correct answer: (D) 4
Explanation
Inserting B, I, N, A, R, Y: I goes right of B, N right of I, A left of B, R right of N, Y right of R. The longest path B-I-N-R-Y has 4 edges, so the height is 4.
Which of the following methods in Java Script will display a window having a dialog box with a specified message, along with an OK and CANCEL button as options?
Aprompt ()
Balert ()
Cconfirm ()
Drequest ()
Show answerHide answer
Correct answer: (C) confirm ()
Explanation
confirm() shows a dialog with a message and OK and Cancel buttons. alert() has only OK, and prompt() asks for text input.
Assume the C++ definition : class circle : public point
Which of the following is false?
A'Point' is the base class and 'circle' is the derived class.
BThe colon (:) in the header of class definition indicates inheritance.
CThe keyword 'public' indicates type of inheritance.
DAll the public and protected members of class 'circle' are inherited as public and protected members, respectively, into class 'point'.
Show answerHide answer
Correct answer: (D) All the public and protected members of class 'circle' are inherited as public and protected members, respectively, into class 'point'.
Explanation
Inheritance goes from base to derived: members of 'point' are inherited into 'circle', not the other way round. So (D) is false.
A self-referential structure has a pointer to its own type: struct node { int data; struct node *link; };. A member of type node itself would be infinitely recursive.
Consider the relation Emp-Dept with SSn as key.
Ename | SSn (key) | EAddr | Dept. No. | Dept. Name | Dept. Manager | SSn
Which of the following is (are) invalid operations (s)?
(i) Inserting an employee without name and address.
(ii) Inserting an employee with only SSn.
(iii) Inserting a department with no employee.
(iv) Inserting an employee without SSn.
A(i)
B(iv)
C(iii) and (iv)
D(ii) and (iii)
Show answerHide answer
Correct answer: (B) (iv)
Explanation
SSn is the primary key, and by entity integrity a key cannot be null. So inserting an employee without an SSn is invalid. Name and address may be null.
Which of the following is a special effect in motion pictures and animations that changes one image/picture into another through a seamless transition?
AModeling
BMorphing
CAnimating
DWrapping
Show answerHide answer
Correct answer: (B) Morphing
Explanation
Morphing smoothly transforms one image into another through a seamless series of in-between frames.
Consider the following Java code segment:
public class while /* line 1*/
{
public void loop ( )
{
int x = 0;
While (1)/* line-6*/
{
system. out. println("x plus one is" + (x+1)):
}
}
}
Which of the following is true ?
AThere is a syntax error in line-1
BThere are syntax errors in line- 1 and line- 6
CThere is a syntax error in line- 6
DNo syntax error
Show answerHide answer
Correct answer: (A) There is a syntax error in line-1
Explanation
while is a reserved keyword in Java, so it cannot be used as a class name. "public class while" is a syntax error on line 1.
Virtual functions give run-time (dynamic) polymorphism: the function called is chosen at run time from the object's actual type. Overloading is resolved at compile time.
In Huffman's coding, if the symbol A has probability 0.3, B has probability 0.15, C has probability 0.1, D has probability 0.25 and E has probability 0.2, then the minimum number of bits required to represent all the symbols together is
A14
B11
C12
D15
Show answerHide answer
Correct answer: (C) 12
Explanation
Huffman merges: 0.1 + 0.15 = 0.25, then 0.2 + 0.25 = 0.45, then 0.25 + 0.3 = 0.55, then 1. The code lengths are A 2, D 2, E 2, B 3, C 3, totalling 2 + 2 + 2 + 3 + 3 = 12 bits.
According to PUTNAM, the project effort is inversely proportional to the fourth power of the development time. Doubling the development schedule for a 100 Person-Month (PM) project would reduce the project effort to
A50 PM
B7.16 PM
C25 PM
D6.25 PM
Show answerHide answer
Correct answer: (D) 6.25 PM
Explanation
Effort ∝ 1/t⁴, so doubling the time divides effort by 2⁴ = 16: 100 ÷ 16 = 6.25 PM.
a ∧ b → b ∨ c is a tautology: whenever a ∧ b is true, b is true, so b ∨ c is true. The other implications can be false, for example when b and c are false.
In how many ways can 8 Indians, 4 Americans and 4 Englishmen be seated in a row so that all persons of same nationality sit together?
A3! 4! 8! 4!
B3! 8!
C4! 4!
D8! 4! 4!
Show answerHide answer
Correct answer: (A) 3! 4! 8! 4!
Explanation
Treat each nationality as one block: the 3 blocks can be arranged in 3! ways. Inside the blocks, Indians arrange in 8!, Americans in 4! and Englishmen in 4!. Total = 3!·8!·4!·4!.
Data warehouses store historical, integrated data for analysis, so they support OLAP (Online Analytical Processing). OLTP runs on operational databases.
Outstanding salary is an expense due but not yet paid, payable within the year, so it is a current liability. Machinery and furniture are fixed assets, and debtors are current assets.
Tina understands the concepts of addition in school, on her way back home she buys some refreshments and calculates the expenses herself. Which component of the curriculum has been highlighted in the above statement?
AValues
BConcept
CApplication
DSubject
Show answerHide answer
Correct answer: (C) Application
Explanation
Tina uses the concept of addition in a real-life situation (shopping), which shows the application component of the curriculum.
Which of the following is not a learning disability ?
AVisual impairment
Bdysgraphia
CDyslexia
DDyscalculia
Show answerHide answer
Correct answer: (A) Visual impairment
Explanation
Visual impairment is a sensory disability, not a learning disability. Dysgraphia (writing), dyslexia (reading) and dyscalculia (mathematics) are learning disabilities.
If a child is suffering from dyslexia, the teacher should adopt the following remedial strategy.
Ahelping them to develop their listening skills by tracking the words provided from the audio book / recorded study material / materials
BContinuing the learning process without any modifications
CProviding counting materials such as counters, rulers, etc
DDoing physical exercises showing the directions like left and right
Show answerHide answer
Correct answer: (A) helping them to develop their listening skills by tracking the words provided from the audio book / recorded study material / materials
Explanation
Children with dyslexia struggle with reading text. Audio books and recorded material help them learn by listening while they follow the words.
A teacher can respond to the interests of children with special needs by following :
ABeing aware of the individual differences of students and creating personalized learning materials
BIgnoring individual differences
CMake them sit separately in the classroom so that they do not mix other children
DAsking other students to address them as underprivileged and express sympathy
Show answerHide answer
Correct answer: (A) Being aware of the individual differences of students and creating personalized learning materials
Explanation
Inclusive teaching means recognising individual differences and adapting or personalising learning materials. It does not mean ignoring, isolating or pitying children with special needs.