DSSSB TGT / PGT · Computer Science

Data Structures Previous Year Questions

144 Data Structures (Computer Science) questions asked in DSSSB TGT / PGT previous year papers, each with the correct answer and explanation. Read them free on UTpaper, or attempt the full papers as timed online tests.

  • 144 questions
  • Official answer key
  • Free

Other Computer Science topics

Q1From DSSSB TGT Computer Science Practice Set 5
Which of the following file stream function will move the file pointer to Nth record in a binary file F created with the help of objects of class EMP?
  1. AF.tellg(N)
  2. BF.seekp(N)
  3. CF.seekp((N−1)* sizeof(EMP))
  4. DF.seekp(sizeof(EMP)/N)
Show answerHide answer

Correct answer: (C) F.seekp((N−1)* sizeof(EMP))

Explanation

Records are stored one after another, so the Nth record begins after N−1 records, at byte offset (N−1)*sizeof(EMP). seekp() moves the put pointer there; tellg() only reports the current position.

Q2From DSSSB TGT Computer Science Practice Set 5
Consider the following expression tree. Tree: root is '+'; its left child is 'a' and its right child is '*'; the '*' node has left child 'b' and right child 'c'. In-order, pre-order and post-order traversal of this tree will result into which of the following expressions, respectively.
  1. Aa+bc*, +a*bc, abc*+
  2. Ba+b*c, +abc*, abc*+
  3. Ca+b*c, +a*bc, abc*+
  4. Da+b*c, +a*bc, abc+*
Show answerHide answer

Correct answer: (C) a+b*c, +a*bc, abc*+

Explanation

In-order (left, root, right) gives a+b*c, pre-order (root first) gives +a*bc, and post-order (root last) gives abc*+.

Q3From DSSSB TGT Computer Science Practice Set 5
Sequential, direct, random and associative are access methods and key characteristics of computer ______ system.
  1. AStack
  2. BCounter
  3. CMemory
  4. DCore
Show answerHide answer

Correct answer: (C) Memory

Explanation

Sequential, direct, random and associative access are the access methods used to describe computer memory systems.

Q4From DSSSB TGT Computer Science Practice Set 5
The diagram below represents Figure: a log-scale graph of 'Transistors per chip' (10³ to 10⁹) on the vertical axis against years 1970 to 2010 on the horizontal axis; the plotted points rise along a straight line on the log scale (doubling at regular intervals), ending at a '1 billion transistor CPU' near 2010.
  1. AMoore' law.
  2. BNewton Raphson method.
  3. CBoyle's law.
  4. DGregor law.
Show answerHide answer

Correct answer: (A) Moore' law.

Explanation

The log-scale graph shows transistors per chip doubling at regular intervals, which is Moore's law.

Q5From DSSSB TGT Computer Science Practice Set 5
In the context of Visual Basic, multiple controls of the same type can be grouped into an array, in the same manner as a collection of data items. Such a grouping is known as :
  1. AControl array
  2. BPrimary array
  3. CSecondary array
  4. DAn integer array
Show answerHide answer

Correct answer: (A) Control array

Explanation

A control array is a group of controls of the same type that share one name and are told apart by an Index property.

Q6From DSSSB TGT Computer Science Practice Set 5
What is common in three different types of traversals (inorder, preorder and postorder)?
  1. ARoot is visited before right subtree
  2. BLeft subtree is always visited before right subtree
  3. CRoot is visited after left subtree
  4. DAll of the above
Show answerHide answer

Correct answer: (B) Left subtree is always visited before right subtree

Explanation

In inorder, preorder and postorder the left subtree is always visited before the right subtree. Only the position of the root changes.

Q7From DSSSB TGT Computer Science Practice Set 5
Which of the following traversal techniques lists the nodes of a binary search tree in ascending order?
  1. APostorder
  2. BPreorder
  3. CInorder
  4. DNone of the above
Show answerHide answer

Correct answer: (C) Inorder

Explanation

In a BST, an inorder traversal (left, root, right) visits the keys in ascending order.

Q8From DSSSB TGT Computer Science Practice Set 5
The five items P,Q,R,S and T are pushed in a stack, one after the other starting from P. The stack is popped four times and each element is inserted in a queue. Then two elements are deleted from the queue and pushed back on the stack. Now one item is popped from the stack, The popped item is :
  1. AS
  2. BP
  3. CQ
  4. DR
Show answerHide answer

Correct answer: (A) S

Explanation

After pushing P to T, popping four times sends T, S, R, Q to the queue, leaving P on the stack. Dequeuing two gives T and S, which are pushed back (stack P, T, S). The next pop returns S.

Q9From DSSSB TGT Computer Science Practice Set 5
When a subroutine is called, the address of the instruction following the CALL instructions stored in/on the ______.
  1. AProgram counter
  2. BStack
  3. CStack pointer
  4. DAccumulator
Show answerHide answer

Correct answer: (B) Stack

Explanation

CALL pushes the return address (the address of the next instruction) onto the stack, and RET pops it back into the program counter.

Q10From DSSSB TGT Computer Science Practice Set 5
In XML, what is the single top level element called that can contain any number of nested subelements ?
  1. ANode element
  2. BRoot element
  3. CMeta element
  4. DSource element
Show answerHide answer

Correct answer: (B) Root element

Explanation

An XML document has exactly one root element, which encloses every other element.

Q11From DSSSB TGT Computer Science Practice Set 4
The concatenation of two lists is to be performed in O(1) time. Which of the following implementations of lists could be used?
  1. ASingly linked list
  2. BDoubly linked list
  3. CCircular doubly linked list
  4. 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.

Q12From DSSSB TGT Computer Science Practice Set 4
Which of the following sorting algorithms uses recursion?
  1. AInsertion Sort
  2. BHeap Sort
  3. CMerge Sort
  4. DBubble Sort
Show answerHide answer

Correct answer: (C) Merge Sort

Explanation

Merge sort splits the array, recursively sorts each half and merges them. Insertion, bubble and heap sort are usually written iteratively.

Q13From DSSSB TGT Computer Science Practice Set 4
Which of the following method is used to move the file pointer to read the content from a specific position in a text file inside a Python program?
  1. AMove
  2. BTell
  3. CFind
  4. DSeek
Show answerHide answer

Correct answer: (D) Seek

Explanation

seek(offset) moves the file pointer to a given position. tell() only reports the current position.

Q14From DSSSB TGT Computer Science Practice Set 4
A binary search tree with N integers may have height ______ in the best case, and ______ in the worst case.
  1. AO(N), O(N)
  2. BO(N²), N
  3. CO(log₂N), O(N²)
  4. DO(log₂N), N−1
Show answerHide answer

Correct answer: (D) O(log₂N), N−1

Explanation

A balanced BST has height O(log₂N). If keys are inserted in sorted order the tree becomes a chain with height N−1.

Q15From DSSSB TGT Computer Science Practice Set 4
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).
  1. ABUS
  2. BRING
  3. CSTAR
  4. 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.

Q16From DSSSB TGT Computer Science Practice Set 4
Which of the following search algorithm requires a sorted array ?
  1. ALinear search
  2. BHash search
  3. CBinary search
  4. 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.

Q17From DSSSB TGT Computer Science Practice Set 4
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.
  1. ABinary tree
  2. BRecursive tree
  3. CInsert sort
  4. 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.

Q18From DSSSB TGT Computer Science Practice Set 4
Which of the following is the correct declaration of linked list?
  1. AStruct node* { int data; node * link; }
  2. BStruct node { int data; struct node* link; }
  3. CStruct node { int data; node link; }
  4. DStruct node* { int data; struct node* link; }
Show answerHide answer

Correct answer: (B) Struct node { int data; struct node* link; }

Explanation

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.

Q19From DSSSB TGT Computer Science Practice Set 4
From a complete graph by removing maximum ______ edges, we can construct a spanning tree.
  1. Ae − n + 1
  2. Bn − e + 1
  3. Cn + e − 1
  4. De − n − 1
Show answerHide answer

Correct answer: (A) e − n + 1

Explanation

A spanning tree of n vertices keeps exactly n − 1 edges. So from a graph with e edges you remove e − (n − 1) = e − n + 1 edges.

Q20From DSSSB TGT Computer Science Practice Set 3
Which of the following algorithms use recursion for sorting an array of integers?
  1. ABubble sort and Insertion sort
  2. BBubble sort and Quick sort
  3. CBubble sort and merge sort
  4. DQuick sort and merge sort
Show answerHide answer

Correct answer: (D) Quick sort and merge sort

Explanation

Quick sort and merge sort are divide-and-conquer algorithms and are normally written recursively. Bubble sort and insertion sort are simple iterative algorithms.

Q21From DSSSB TGT Computer Science Practice Set 3
Consider the following three binary trees, each with 7 nodes. Tree A: root has a left child that is a leaf and a right child X; X has a left child Y and a right child that is a leaf; Y has two leaf children. Tree B: root has a left child L and a right child R; L has only a left child (a leaf); R has only a left child Z; Z has two leaf children. Tree C: root has two children, and each of them has two leaf children (a full tree of height 2). Then A is ______ binary tree, B is ______ binary tree and C is ______ binary tree.
  1. AStrictly, strictly, complete
  2. BComplete, not strictly, strictly
  3. CStrictly, not strictly, strictly
  4. DStrictly, not strictly, complete
Show answerHide answer

Correct answer: (D) Strictly, not strictly, complete

Explanation

Tree A is strictly binary because every node has 0 or 2 children. Tree B is not, because L and R each have only one child. Tree C is a full tree of height 2 with every level filled, so it is complete.

Q22From DSSSB TGT Computer Science Practice Set 3
The elements of the triangular array are stored as a vector in the order A[1, 1], A[2, 1], A[2, 2], A[3, 1], A[3, 2], A[3, 3] ......... A[n, n]. Assuming that A[1, 1] is stored at location 1, addressing function for A[i, j] is given by:
  1. A(i−1)/2 + j
  2. B((i−1)*i)/2 + j
  3. C(i×i)/2 + j
  4. D(i*j−1)/2
Show answerHide answer

Correct answer: (B) ((i−1)*i)/2 + j

Explanation

Rows 1 to i−1 hold 1 + 2 + … + (i−1) = i(i−1)/2 elements. A[i, j] is the j-th element of row i, so its location is i(i−1)/2 + j. Check: A[1,1] gives 0 + 1 = 1.

Q23From DSSSB TGT Computer Science Practice Set 3
What is the meaning of the following declaration in C programming language? int (*p) [5];
  1. AIt will result in compile error because there should not be any parenthesis, i.e., "int*p[5]" is valid
  2. Bp is a pointer to 5 integers
  3. Cp is a pointer to integer array
  4. Dp is a pointer to an array of 5 integers
Show answerHide answer

Correct answer: (D) p is a pointer to an array of 5 integers

Explanation

The parentheses bind * to p first, so p is a pointer, and that pointer points to an array of 5 ints. Without parentheses, int *p[5] would be an array of 5 pointers to int.

Q24From DSSSB TGT Computer Science Practice Set 3
A register in the microprocessor that keeps track of the answer or result of any arithmetic or logic operation is the ______.
  1. AAccumulator
  2. BStack pointer
  3. CProgram counter
  4. DInstruction pointer
Show answerHide answer

Correct answer: (A) Accumulator

Explanation

The accumulator holds an operand and stores the result of arithmetic and logic operations. The program counter holds the next instruction's address, and the stack pointer holds the top of the stack.

Q25From DSSSB TGT Computer Science Practice Set 3
Zero address instructions are necessarily used in ______ architecture.
  1. AStack
  2. BCISC
  3. CRISC
  4. DParallel
Show answerHide answer

Correct answer: (A) Stack

Explanation

A stack machine takes its operands implicitly from the top of the stack. So instructions like ADD need no address fields, which makes them zero-address instructions.

Q26From DSSSB TGT Computer Science Practice Set 2
Which of the following file stream function will not move the file pointer to (N+1)th record of a binary file F created with the help of objects of class EMPLOYEE ?
  1. AF. seekp (N*sizeof (EMPLOYEE));
  2. BF. seekg (F.tellg( )*N);
  3. CF. seekg (sizeof (EMPLOYEE)*N);
  4. DPOS = sizeof (EMPLOYEE)*N;
Show answerHide answer

Correct answer: (B) F. seekg (F.tellg( )*N);

Explanation

seekg(F.tellg()*N) multiplies the current position by N, which is not the offset of the (N+1)th record. The correct offset is N*sizeof(EMPLOYEE).

Q27From DSSSB TGT Computer Science Practice Set 2
The following figure is a ______ tree after zig_Zig rotations. Tree: root X; X has left child A and right child P; P has left child B and right child G; G has left child C and right child D.
  1. AHeap
  2. BBubble
  3. CSplay
  4. DBinary
Show answerHide answer

Correct answer: (C) Splay

Explanation

Zig-zig rotations are the restructuring steps of a splay tree, which move an accessed node up to the root.

Q28From DSSSB TGT Computer Science Practice Set 2
The worst case complexity for searching an element in binary search tree is:
  1. AO(lgn)
  2. BO(nlgn)
  3. CO(n²)
  4. DO(n)
Show answerHide answer

Correct answer: (D) O(n)

Explanation

A skewed (degenerate) BST is like a linked list, so a search may have to visit all n nodes: O(n) in the worst case.

Q29From DSSSB TGT Computer Science Practice Set 2
In VB, to change the size of a dynamic array, ______ is used at the point in the code where you want it to change.
  1. ADim
  2. BRedim
  3. CChdim
  4. DBydim
Show answerHide answer

Correct answer: (B) Redim

Explanation

ReDim resizes a dynamic array in VB (ReDim Preserve also keeps its existing contents). Dim only declares the array.

Q30From DSSSB TGT Computer Science Practice Set 2
In the given graph identify the cut vertices : Graph: vertices A, B, C, D, E; edges A-B, A-D, D-B, B-C, C-E.
  1. AB and E
  2. BC and D
  3. CA and E
  4. DC and B
Show answerHide answer

Correct answer: (D) C and B

Explanation

Removing B separates {A, D} from {C, E}, and removing C cuts off E. Removing A, D or E leaves the graph connected, so the cut vertices are B and C.

Q31From DSSSB TGT Computer Science Practice Set 2
A B-Tree is of order p and consists of n keys. Its maximum height is
  1. Alog_(p/2) (n+1)/2
  2. Blog_p n
  3. Clog_(p/2) (n+1)
  4. DNone of the above
Show answerHide answer

Correct answer: (A) log_(p/2) (n+1)/2

Explanation

In a B-tree of order p, every non-root node has at least ⌈p/2⌉ children. So the maximum height is log base ⌈p/2⌉ of (n+1)/2.

Q32From DSSSB TGT Computer Science Practice Set 2
The following postfix expression with single-digit operands is evaluated using a stack: 823^/23*+51*- (Note that ^ is the exponentiation operator.) The top two elements of the stack after the first * is evaluated, are
  1. A6, 1
  2. B5, 7
  3. C3, 2
  4. D1, 5
Show answerHide answer

Correct answer: (A) 6, 1

Explanation

8 2 3 ^ gives 2³ = 8, then 8 / 8 = 1. Next 2 and 3 are pushed and * gives 6. The stack now holds 1, 6, so the top two elements are 6 and 1.

Q33From DSSSB TGT Computer Science Practice Set 2
Recursive procedures is implement using:
  1. AString
  2. BQueue
  3. CStack
  4. DLinked List
Show answerHide answer

Correct answer: (C) Stack

Explanation

Each recursive call pushes its return address and local variables onto a stack, so recursion is implemented with a stack.

Q34From DSSSB TGT Computer Science Practice Set 2
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?
  1. A5
  2. B2
  3. C3
  4. D4
Show answerHide answer

Correct answer: (D) 4

Explanation

Inserting B, I, N, A, R, Y gives root B with A on the left and the chain I → N → R → Y to the right. The longest path B-I-N-R-Y has 4 edges, so the height is 4.

Q35From DSSSB TGT Computer Science Practice Set 2
Observe the following graph and find the missing statement in the Python code. import matplotlib.pyplot as pl ______ pl. show() Graph: a single line joining the points (0.0, 5), (1.0, 2), (2.0, 3), (3.0, 1); x-axis 0.0 to 3.0, y-axis 1.0 to 5.0.
  1. Apl.bar ([5, 2, 3, 1])
  2. Bpl.scatter ([5, 2, 3, 1])
  3. Cpl.plot ([5, 2, 3, 1])
  4. Dpl.line ([5, 2, 3, 1])
Show answerHide answer

Correct answer: (C) pl.plot ([5, 2, 3, 1])

Explanation

pl.plot([5, 2, 3, 1]) draws a line graph, using the indexes 0-3 as x values. bar and scatter give different charts, and pl.line does not exist.

Q36From DSSSB TGT Computer Science Practice Set 2
The number of pointer changes required for inserting a node between two given nodes in the linked implementation of a doubly linked list is ______.
  1. AOne
  2. BTwo
  3. CThree
  4. DFour
Show answerHide answer

Correct answer: (D) Four

Explanation

The new node's next and prev pointers are set, and the next pointer of the previous node and the prev pointer of the following node are updated. That makes 4 pointer changes.

Q37From DSSSB TGT Computer Science Practice Set 2
Which of the following options is the correct code for traversing a link list staring at pointer P, upto element X ?
  1. AWhile (P == NULL || P → Element ! = X) P = P → Next ;
  2. BWhile (P == NULL && P → Element ! = X) P = P → Next ;
  3. CWhile (P ! = NULL || P → Element ! = X) P = P → Next ;
  4. DWhile (P ! = NULL && P → Element ! = X) P = P → Next ;
Show answerHide answer

Correct answer: (D) While (P ! = NULL && P → Element ! = X) P = P → Next ;

Explanation

The loop must stop at the end of the list or when X is found, so it continues only while P != NULL && P→Element != X. Checking for NULL first also avoids dereferencing a null pointer.

Q38From DSSSB TGT Computer Science Practice Set 1
What will the following code result in? import numpy as np A = np.array ([12, 23]) B = np.array ([10, 20]) print (A-B)
  1. A[-2 -3]
  2. B[[12 23] [10 20]]
  3. C[[10 20] [12 23]]
  4. D[2 3]
Show answerHide answer

Correct answer: (D) [2 3]

Explanation

NumPy subtracts arrays element by element: [12−10, 23−20] = [2 3]. It does not stack or combine the arrays.

Q39From DSSSB TGT Computer Science Practice Set 1
Consider the following two C++ statements and the accompanying contexts. (A) return P→next = = NULL; // P is a pointer to an element in the link list L. (B) return S → next == NULL; // S is a stack implemented as a link list. If the return value is TRUE in both cases, which of the following is correct ?
  1. AP points to the last element in L and S is empty.
  2. BP points to the last element in L and S is full.
  3. CL is empty and S is full.
  4. DBoth L and S are empty.
Show answerHide answer

Correct answer: (B) P points to the last element in L and S is full.

Explanation

Answer as per the book's key (b). Note that S→next == NULL would normally mean the stack is empty, so this question is doubtful.

Q40From DSSSB TGT Computer Science Practice Set 1
Given the following program fragment to add two integer arrays A and B, each of size N. The sum is stored in integer array C of the same size. for (i=1; i<=N; i++) C[i] = A[i]+B[i]; The running time of this for loop is ______.
  1. AO(1)
  2. BO(N)
  3. CO(2N)
  4. DO(N²)
Show answerHide answer

Correct answer: (B) O(N)

Explanation

The loop body does constant work and runs N times, so the running time is linear, O(N). O(2N) also simplifies to O(N).

Q41From DSSSB TGT Computer Science Practice Set 1
The figure below represents a ______ sort. Figure (tree): Leaves (left to right): 44, 55, 12, 42, 94, 18, 06, 67 Level above leaves: 44 (from 44, 55), 12 (from 12, 42), 18 (from 94, 18), 06 (from 06, 67) Next level: 12 (from 44, 12), 06 (from 18, 06) Root: 06 (from 12, 06)
  1. ABubble
  2. BShake
  3. CTree
  4. DInsertion
Show answerHide answer

Correct answer: (C) Tree

Explanation

The figure compares pairs, moves the smaller key up each level and puts the minimum (06) at the root. This tournament-style structure is tree (tournament) sort.

Q42From DSSSB TGT Computer Science Practice Set 1
For the following binary tree inorder traversal yields the expression : Binary tree: root is '−'; its left child is '+' and its right child is '/'. '+' has left child 'a' and right child '*'; '*' has children 'b' (left) and 'd' (right). '/' has children 'e' (left) and 'f' (right).
  1. A− + * / abdef
  2. Ba + bd * − ef /
  3. Cabdef* / + −
  4. Da + b * d − e/f
Show answerHide answer

Correct answer: (D) a + b * d − e/f

Explanation

Inorder traversal visits left subtree, root, then right subtree. Left subtree gives a + b * d, then the root −, then the right subtree e / f, giving a + b * d − e/f.

Q43From DSSSB TGT Computer Science Practice Set 1
Which of the following Java statements declare and allocate a 2-dimensional array of integers with four rows and five columns.
  1. Aint array [][] = new int [5][4];
  2. Bint array [4][5];
  3. Cint array [5][4];
  4. Dint array [][] = new int [4][5];
Show answerHide answer

Correct answer: (D) int array [][] = new int [4][5];

Explanation

In Java, new int[4][5] creates 4 rows and 5 columns. Declarations like int array[4][5] are not valid Java, and [5][4] has the dimensions reversed.

Q44From DSSSB TGT Computer Science Practice Set 1
Which of the following data structures is most suitable for evaluating postfix expressions?
  1. ATree
  2. BStack
  3. CLinked list
  4. DQueue
Show answerHide answer

Correct answer: (B) Stack

Explanation

Operands are pushed onto a stack. When an operator is read, the top two operands are popped, the operator is applied and the result is pushed back, so a stack is the natural structure for postfix evaluation.

Q45From DSSSB TGT Computer Science Practice Set 1
In C language
  1. AParameters are always passed by values
  2. BParameter are always passed by reference
  3. CNon-pointer variables are passed by value and pointers are passed by reference
  4. DParameters are alsways passed by value result
Show answerHide answer

Correct answer: (A) Parameters are always passed by values

Explanation

C supports only call by value. Even a pointer is passed by value (a copy of the address); call by reference is only simulated by using that address.

Q46From DSSSB TGT Computer Science Practice Set 1
In C++, which of the following statements correctly returns the memory from the dynamic array pointer pp to the free store?
  1. Adelete pp;
  2. Bdelete pp [];
  3. Cdelete [] pp;
  4. Ddelete *pp;
Show answerHide answer

Correct answer: (C) delete [] pp;

Explanation

Memory allocated with new[] for an array must be freed with delete [] pp, so that the whole array is released and destructors run for every element.

Q47From DSSSB TGT Computer Science Practice Set 1
Which of the following is an invalid method/function in a Python dictionary?
  1. Apopitem ()
  2. Bremove ()
  3. Cget ()
  4. Dpop ()
Show answerHide answer

Correct answer: (B) remove ()

Explanation

Python dictionaries have pop(), popitem() and get(), but no remove() method. remove() belongs to lists and sets.

Q48DSSSB PGT Computer Science (Technical), 11 Jul 2021
What is responsibility of event queue in event driven programming?
  1. ACreate new event
  2. BDelete the event
  3. CMake a sequence in which event is executed
  4. DChange the event
Show answerHide answer

Correct answer: (C) Make a sequence in which event is executed

Explanation

The event queue holds incoming events and decides the order (sequence) in which they are dispatched and handled.

Q49DSSSB PGT Computer Science (Technical), 11 Jul 2021
A complete binary tree T have n leaf nodes. What is the number of nodes with degree of 2 in tree T?
  1. An
  2. Bn/2
  3. Cn − 1
  4. D2n
Show answerHide answer

Correct answer: (C) n − 1

Explanation

In any binary tree, the number of leaf nodes is one more than the number of nodes with two children, so n leaves means n − 1 nodes of degree 2.

Q50DSSSB PGT Computer Science (Technical), 11 Jul 2021
Which statement is true about condition of overflow in the circular Queue? I. Front = 1 and Rear = N II. Front = Rear + 1
  1. AOnly I
  2. BOnly II
  3. CBoth I and II
  4. DNeither I nor II
Show answerHide answer

Correct answer: (C) Both I and II

Explanation

In a 1-based circular queue of size N, it is full (overflow) when Front = 1 and Rear = N, or when Front = Rear + 1 (rear has wrapped round to just behind front).

How to use these DSSSB TGT / PGT Computer Science questions

Every question here was asked in a real DSSSB TGT / PGT 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 DSSSB TGT / PGT papers as timed tests to check your speed under exam conditions.

More DSSSB TGT / PGT subjects