Sample Questions, Previous Year Solved Papers, Study Materials For Competitive Examinations Like UGC NET, SET And GATE Computer Science.

## Data Structures and Algorithms Multiple Choice Questions - Set 10

August 26, 2017
91.       Applications of Linked List are
(A) Simulation, event driven systems
(B) Postfix and prefix manipulations
(C) Dictionary systems, polynomial manipulations
(D) Fixed block storage allocation, garbage collection
92.       AVL trees have LL, LR, RR, RL rotations to balance the tree to maintain the balance factor (LR : Insert node in Right sub tree of Left sub tree of node A, etc). Among rotations the following are single and double rotations
(A) LL, RL and LR, RR
(B) LL, RR and LR, RL
(C) LR, RR and LL, RL
(D) LR, RL and LR, RL
93.       Hashing collision resolution techniques are:
(A) Huffman coding, linear hashing
(C) Chaining, Huffman coding
94.       After each iteration in bubble sort:
(A) at least one element is at its sorted position.
(B) one less comparison is made in the next iteration.
(C) Both (A) & (B) are true.
(D) Neither (A) or (B) are true.
95.       The running time of the following sorting algorithm depends on whether the partitioning is balanced or unbalanced.
(A) Insertion sort
(B) Selection sort
(C) Quick sort
(D) Merge sort

96.       A procedure that calls itself is called ...............
(A) illegal call
(B) reverse polish
(C) recursive
(D) None of these
97.       Graphs are represented using ............
98.       The average case complexity of Insertion Sort is
(A) O(2n)
(B) O(n3)
(C) O(n2)
(D) O(2n)
99.       Heap is an example of ................
(A) complete binary tree
(B) spanning tree
(C) sparse tree
(D) binary search tree
100.    Infinite recursion leads to ...............
(A) Overflow of run-time stack
(B) Underflow of registers usage
(C) Overflow of I/O cycles
(D) Underflow of run-time stack

## Data Structures and Algorithms Multiple Choice Questions - Set 9

August 25, 2017
81.       The number of edges in a simple, n-vertex, complete graph is
(A) n*(n-2)
(B) n*(n-1)
(C) n*(n-1)/2
(D) n*(n-1)*(n-2)
82.       Match the following:
List - I
i. Bubble Sort
ii. Shell Sort
iii. Selection Sort
List - II
a. ÎŸ(n)
b. ÎŸ(n2)
c. ÎŸ(n log n)
(A) i → a,  ii → b,  iii → c
(B) i → b,  ii → c,  iii → a
(C) i → a,  ii → c,  iii → b
(D) i → b,  ii → a,  iii → c
83.       A double sub-scripted array declared as int a[ 3 ][ 5 ]; has how many elements?
(A) 15
(B) 13
(C) 10
(D) 8
84.       The largest and the second largest number from a set of n distinct numbers can be found in
(A) O(n)
(B) O(2n)
(C) O(n2)
(D) O(log n)
85.       To implement Sparse matrix dynamically, the following data structure is used
(A) Trees
(B) Graphs
(C) Priority Queues

86.       The depth dn, of complete binary tree of n nodes, where nodes are labelled from 1 to n with root as node 1 and last leaf node as node n is
87.       Which file open mode would be used to write data only to the end of an existing file?
(A) ios::app
(B) ios::in
(C) ios::out
(D) ios::trunc
88.       The balance factor for an AVL tree is either
(A) 0,1 or -1
(B) -2,-1 or 0
(C) 0,1 or 2
(D) All the above
89.       Tower of Hanoi is a classic example of ..............
(A) divide and conquer
(B) recursive approach
(C) (B) but not (A)
(D) Both (A) & (B)
90.    Which of the following searching techniques do not require the data to be in sorted form?
(A) Binary Search
(B) Interpolation Search
(C) Linear Search
(D) All of the above

## Data Structures and Algorithms Multiple Choice Questions - Set 8

August 24, 2017
71.       A tree in which, for every node, the difference between the height of its left subtree and right subtree is not more than one is
(A) AVL Tree
(B) Complete Binary Tree
(C) B – Tree
(D) B+ Tree
72.       The data structure needed to convert a recursion to an iterative procedure is ............
(A) Queue
(B) Graph
(C) Stack
(D) Tree
73.       Which of the following uses FIFO method?
(A) Queue
(B) Stack
(C) Hash Table
(D) Binary Search Tree
74.       A binary tree stored using linked representation can be converted to its mirror image by traversing it in ...............
(A) In-order
(B) Pre-order
(C) Post-order
(D) Any order
75.       Minimum number of spanning tree in a connected graph is .............
(A) n
(B) nn - 1
(C) 1
(D) 0

76.       Which of the following algorithm cannot be designed without recursion?
(A) Tower of Hanoi
(B) Fibonacci Series
(C) Tree Traversal
(D) None of the above
77.       The prefix form of an infix expression A+B-C*D is
(A) +AB-*CD
(B) -+A B C * D
(C) -+A B * C D
(D) - + *ABCD
78.       Binary search tree is an example of complete binary tree with special attributes:
(A) BST does not care about complete binary tree properties.
(B) BST takes care of complete binary tree properties.
(C) It depends upon the input.
(D) None of the above.
79.       For a binary search algorithm to work, it is necessary that the array must be ............
(A) sorted
(B) unsorted
(C) in a heap
(D) popped out of stack
80.    A random access file is organized most like a(n):
(A) Array
(B) Object
(C) Class
(D) Pointer

## Data Structures and Algorithms Multiple Choice Questions - Set 7

August 23, 2017
61.       To write fixed-length records, use file open mode:
(A) ios::app
(B) ios::ate
(C) ios::trunc
(D) ios::binary
62.       A complete Binary Tree with 15 nodes contains ................. edges
(A) 15
(B) 30
(C) 14
(D) 16
63.       If there is no base criteria in a recursive program, the program will ................
(A) not be executed
(B) execute until all conditions match
(C) execute infinitely
(D) obtain progressive approach
64.       The minimum number of comparisons required to find the largest number from 4 different numbers are
(A) 4
(B) 3
(C) 5
(D) 6
65.       Visiting root node after visiting left and right sub-trees is called .............
(A) In-order Traversal
(B) Pre-order Traversal
(C) Post-order Traversal
(D) None of these

66.       Suppose each set is represented as a linked list with elements in arbitrary order. Which of the operations among union, intersection, membership, cardinality will be the slowest?
(A) union only
(B) intersection, membership
(C) membership, cardinality
(D) union, intersection
67.       An infix expression can be converted to a postfix expression using a .................
(A) Stack
(B) Queue
(C) Dequeue
(D) None of these
68.       A data structure in which an element is added and removed only from one end, is known as
(A) Queue
(B) Stack
(C) In-built structure
(D) None of the above
69.       A complete binary tree with the property that the value of each node is at least as large as the values of its children is known as ..............
(A) Binary Search Tree
(B) AVL Tree
(C) Heap
70.    A sorting algorithm is stable if
(A) its time complexity is constant irrespective of the nature of input.
(B) preserves the original order of records with equal keys.
(C) its space complexity is constant irrespective of the nature of input.
(D) it sorts any volume of data in a constant time.

## Data Structures and Algorithms Multiple Choice Questions - Set 6

August 22, 2017
51.       A graph with n vertices will definitely have a parallel edge or self loop if the total number of edges are
(A) more than n
(B) more than n+1
(C) more than (n+1)/2
(D) more than n(n-1)/2
52.       In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element is ............
(A) log2 n
(B) n/2
(C) log2 n-1
(D) n
53.       Index of arrays in C programming language starts from.............
(A) 0
(B) 1
(C) either 0 or 1
(D) undefined
54.       Out of the following, the slowest sorting procedure is
(A) Quick Sort
(B) Heap Sort
(C) Shell Sort
(D) Bubble Sort
55.       The minimum number of edges required to create a cyclic graph of n vertices is .............
(A) n
(B) n - 1
(C) n + 1
(D) 2n

56.       In .............., it is possible to traverse a tree without using stacks either implicitly or explicitly.
(B) AVL Tree
(C) B+ tree
(D) Heap
57.       The order of a B-Tree with 2, 3, 4 or 5 children in every internal node is
(A) 2
(B) 3
(C) 4
(D) 5
58.       Prefix notation is also known as ...............
(A) Reverse Polish Notation
(B) Reverse Notation
(C) Polish Reverse Notation
(D) Polish Notation