You are on page 1of 12

SECTION A

1) What is the worst case time complexity of linear search algorithm?


A - Ο(1) B - Ο(n) C - Ο(log n) D - Ο(n2)

2) Which one of the below mentioned is linear data structure −


A – Queue B – Stack C – Arrays D - All of the above

3) The following formula will produce: Fn = Fn-1 + Fn-2


A - Armstrong Number B - Fibonacci Series
C - Euler Number D -Prime Number

4) Visiting root node after visiting left and right sub-trees is called
A - In-order Traversal B - Pre-order Traversal C - Post-order Traversal

5) The number of binary trees with 3 nodes which when traversed in post order gives the
sequence A,B,C is ?
A 3 B 4 C 5 D 6

6) Which of the following is not possible with an array in C programming language −


A – Declaration B – Definition C - Dynamic Allocation D - Array of strings

7) Heap is an example of
A - complete binary tree B - spanning tree
C - sparse tree D - binary search tree

8) If locality is a concern, you can use _______ to traverse the graph.


A - Breadth First Search B - Depth First Search
C - Either BFS or DFS D - None of the above!

9) Which of the following algorithm does not divide the list −


A - linear search B - binary search
C - merge sort D - quick sort

10) For a binary search algorithm to work, it is necessary that the array (list) must be
A – sorted B – unsorted C - in a heap D - popped out of stack

11) What data structure is used for depth first traversal of a graph?
A – queue B – stack C – list D - none of the above

12) Quick sort algorithm is an example of


A - Greedy approach B - Improved binary search
C - Dynamic Programming D - Divide and conquer

13) Maximum degree of any vertex in a simple graph of vertices n is


A - 2n – 1 B–n C-n+1 D-n-1
14) A priory algorithm analysis does not include −
A - Time Complexity B - Space Complexity
C - Program Complexity D - None of the above!

15) Which of the below given sorting techniques has highest best-case runtime complexity −

1|Page
A - quick sort B - selection sort C - insertion sort D - bubble sort

16) Which of the following is not possible with an array in C programming language −
A – Declaration B – Definition C - Dynamic Allocation D - Array of strings

17) A procedure that calls itself is called


A - illegal call B - reverse polish C – recursive D - none of the above

18) Stack is used for


A - CPU Resource Allocation B - Breadth First Traversal
C – Recursion D - None of the above

19) The following formula is of: left_subtree(keys) <= node(key) <= right_subtree(key)
A - Binary Tree B - Complete Binary Tree
C - Binary Search Tree D - All of the above

20) 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

21) Time complexity of Depth First Traversal of is


A - Θ(|V|+|E|) B - Θ(|V|) C - Θ(|E|) D - Θ(|V|*|E|)

22) Which of the below mentioned sorting algorithms are not stable?
A - Selection Sort B - Bubble Sort C - Merge Sort D - Insertion Sort

23) Index of arrays in C programming language starts from


A–0 B–1 C - either 0 or 1 D – undefined

24) Recursion uses more memory space than iteration because


A - it uses stack instead of queue. B - every recursive call has to be stored.
C - both A & B are true. D - None of the above are true.

25) If the data collection is in sorted form and equally distributed then the run time
complexity of interpolation search is −
A - Ο(n) B - Ο(1) C - Ο(log n) D - Ο(log (log n))

26) Prefix notation is also known as


A - Reverse Polish Notation B - Reverse Notation
C - Polish Reverse Notation D - Polish Notation

27) push() and pop() functions are found in


A – queues B – lists C – stacks D – trees

28) A linked-list is a dynamic structure


A – true B – false

29) Minimum number of spanning tree in a connected graph is


A–n B - nn – 1 C–1 D–0

30) Which of the following is example of in-place algorithm?


A - Bubble Sort B - Merge Sort C - Insertion Sort D - All of the above

2|Page
31) Which of the following is not possible with an array in C programming language −
A – Declaration B – Definition
C - Dynamic Allocation D - Array of strings

32) The max heap is used to sort a list in descending order


A - True B - False

33) Shell sort uses


A - insertion sort B - merge sort C - selection sort D - quick sort

34) A priori analysis of an algorithm assumes that −


A - the algorithm has been tested before in real environment.
B - all other factors like CPU speed are constant and have no effect on
implementation.
C - the algorithm needs not to be practical.
D - none of the above.

35) Which one of the below mentioned is non-linear data structure −


A – Queue B – Trees C – Arrays D - All of the above

36) Travelling salesman problem is an example of


A - Dynamic Algorithm B - Greedy Algorithm
C - Recursive Approach D - Divide & Conquer

37) Which of the following has search efficiency of Ο(1) −


A – Tree B – Heap C - Hash Table D - Linked-List

38) In context with time-complexity, find the odd out −


A - Deletion from Linked List. B - Searching in Hash Table
C - Adding edge in Adjacency Matrix D - Heappify a Binary Heap

39) The Θ notation in asymptotic evaluation represents −


B - Base case C - Average case D - Worst case A-
NULL case

40) Program with highest run-time complexity is


A - Tower of Hanoi B - Fibonacci Series

C - Prime Number Series D - None of the above

41) In a min-heap:
A - parent nodes have values greater than or equal to their children
B - parent nodes have values less than or equal to their children
C - both statements are true
D - both statements are wrong

42) A circular linked list can be used for


A – Stack B – Queue C - Both Stack & Queue D - Neither Stack or Queue

43) Visiting right sub-tree node after visiting left sub-tree followed by the root is called

3|Page
A - In-order Traversal B - Pre-order Traversal C - Post-order Traversal

44) In binary heap, whenever the root is removed then the rightmost element of last level is
replaced by the root. Why?
A - It is the easiest possible way.
B - To make sure that it is still complete binary tree.
C - Because left and right sub-tree might be missing.
D - None of the above!

45) The Big-O of the following code is –

public void printAllPossibleOrderedPairs(int[] arrayOfItems) {


for (int firstItem : arrayOfItems) {
for (int secondItem : arrayOfItems) {
int[] orderedPair = new int[]{firstItem, secondItem};
System.out.println(Arrays.toString(orderedPair));
}
}
}

A – O(n) B – O(n2) C – O(1) D – O(nlogn)

46) In the deletion operation of max heap, the root is replaced by


A - next available value in the left sub-tree. B - next available value in the right sub-tree.
C - any random value from the heap. D - last element of the last level

47) A balance factor in AVL tree is used to check


A - what rotation to make. B - if all child nodes are at same level.
C - when the last rotation occurred. D - if the tree is unbalanced.

48) Project scheduling is an example of


A - greedy programming B - dynamic programming
C - divide and conquer D - none of the above.

49) What is the worst case run-time complexity of binary search algorithm?
A - Ο(n2) B - Ο(nlog n) C - Ο(n3) D – O(n)

50) What data structure can be used to check if a syntax has balanced parentheses?
A – queue B – tree C – list D - Stack

51) Minimum number of queues required for priority queue implementation?


A–5 B–4 C–3 D–2

52) If the array is already sorted, which of these algorithms will exhibit the best performance
A - Merge Sort B - Insertion Sort C - Quick Sort D - Heap Sort

53) Which of the following uses memorization?


A - Greedy approach B - Divide and conquer approach
C - Dynamic programming approach D - None of the above!

54) Tower of Hanoi is a classic example of


A - divide and conquer B - recursive approach

4|Page
C - B but not A D - Both A & B

55) A balance factor in AVL tree is used to check


A - what rotation to make. B - if all child nodes are at same level.
C - when the last rotation occurred. D - if the tree is unbalanced.

56) Interpolation search is an improved variant of binary search. It is necessary for this
search algorithm to work that −
A - data collection should be in sorted form and equally distributed.
B - data collection should be in sorted form and but not equally distributed.
C - data collection should be equally distributed but not sorted.
D - None of the above.

57) What is the worst case time complexity of linear search algorithm?
A - Ο(1) B - Ο(n) C - Ο(log n) D - Ο(n2)

58) An algorithm is
A - a piece of code to be executed.
B - a loosely written code to make final code.
C - a step by step procedure to solve problem.
D - all of the above.

59) Which of the below given sorting techniques has highest best-case runtime complexity −
A - quick sort B - selection sort C - insertion sort D - bubble sort

60) Which of the following statements is true?


A - A graph can be drawn on paper in only one way.
B - Graph vertices may be linked in any manner.
C - A graph must have at least one vertex.
D - A graph must have at least one edge.
61) The process of finding some other position when hash address is occupied is
classified as

A- collision resolution
B- address space resolution
C- multiple hashing resolution
D- chaining resolution

62) The ordered files with primary index are called

A- linear spanned file


B- indexed sequential files
C- relative spanned file
D- indexed spanned file

63) The record searching technique in which the searching of records is done by block
by block is classified as

A- heap search

5|Page
B- non linear search
C- linear search
D- relative search

64) In the disk packs, the tracks are divided into smaller block of information
containing large amount of information called

A- blocks
B- cylinder
C- sector
D- all of above

65) In high level programs, the command which is used to prepare the file for writing
and reading is classified as

A- modify command
B- open command
C- locate command
D- reset command

66) The technique of writing data on two physical disks and treating both disks as one
logical disk unit is classified as

A- shadowing
B- clustering
C- distributing
D- non shadowing

67) Considering storage capacity, the one billion bytes of data are equal to

A- 1 kilo bytes
B- 1 tera bytes
C- 1 mega bytes
D- 1 gega bytes

68) The circles in a disk in which the information is stored are called

A- track
B- cylinder
C- sector
D- blocks

69) If the file load factor is 0.6, blocking factor is 25 and the number of file buckets
are 5 then the current number of records are

A- 95

6|Page
B- 65
C- 75
D- 85

70) If the global depth in extendible hashing is equal to local depth then the operation
must be performed in directory array is

A- adding
B- subtracting
C- halving
D- doubling

71) In external hashing for files of disk, the pointers which contain record position
and block address within the block are classified as

A- position pointers
B- address pointers
C- block pointers
D- record pointers

72) The technique which involves the arithmetic function or logical function is
classified as

A- clustering technique
B- folding technique
C- spanning technique
D- hashing technique

73) The temporary unordered file is also called

A- overflow file
B- heap file
C- sequential file
D- spanned file

74) In high level programs, the command which is used to copy the current record
from buffer to variable of user program is classified as

A- read command
B- find next command
C- modify command
D- insert command

75) In disks, the tracks having same diameter on different surfaces are classified as

A- sector

7|Page
B- blocks
C- track
D- cylinder

76) In high level programs, the command which sets the pointer of file to the
beginning of that file is classified as

A- modify command
B- open command
C- locate command
D- reset command

77) The time required to position write or read track on correct place is classified as

A- reel time
B- seek time
C- rotational delay
D- transfer time of block

78) Considering storage capacity, the 2000 bytes of data are equal to

A- 1 tera bytes
B- 2 kilobytes
C- 1 mega bytes
D- 2 mega bytes

79) The concept in which extra bit or byte is stored for record deletion and that extra
stored bit is called

A- insertion marker
B- deletion marker
C- modifying marker
D- static marker

80) The hashing process if used for disk files is classified as

A- preserving hashing
B- external hashing
C- internal hashing
D- reversal hashing

81) The fields which are used to retrieve the related records from other files are called

A- secondary fields
B- primary fields
C- key fields

8|Page
D- connecting fields

82) The command in DBMS software which is used to locate records that fulfills the
search condition is classified as

A- Find All command


B- Find n
C- Find Ordered command
D- Reorganize command

83) Considering the disks, the command with which the buffer is copied into the
block of disk is classified as

A- write command
B- read command
C- paste command
D- cut command

84) The magnetic tapes are examples of

A- random access storage devices


B- sequential access devices
C- inter-block access devices
D- archive storage device

85) The kind of hashing technique in which a directory of having addresses 2d is


maintained is called

A- dynamic hashing
B- extendible hashing
C- non extendible hashing
D- static hashing

86) The type of organization in which the records are inserted at the end of stored file
is classified as

A- pile file
B- linear search file
C- relative file
D- external file

87) The kind of field with which the record searching is done is classified as

A- sorting field
B- relative field
C- linear field

9|Page
D- ordering field

88) The example of tertiary storage media is

A- magnetic disks
B- optical disks
C- removable media
D- cache memory

89) a disk units which has an actuator attached into it are called

A- transfer disks
B- mechanical disks
C- moveable-head disks
D- fixed-head disks

90) Which one is not a type of a queue:


(a) Dequeue (b) Circular Queue
(b) Priority Queue (d) Non-linear Queue

91) Which one is the simplest data structure:


(a) Array (b) Linked List
(c) Tree (d) Struct

92) Which is not a data structure:


(a) Array (b) Linked List
(c) Binary (d) Struct

93) For balancing a tree we use:


(a) Left rotation (b) Right rotation
(c) Both (d) None

94) Which one is not a linear data structure:


(a) Array (b) Stack
(c) Queue (d) Tree

95) Searching Techniques in Graph are :


(a) Breadth-last Search & Depth- first Search(b) Depth- last Search & Breadth-first Search
(c) Breadth-first Search & Depth- first Search(d) Breadth-last Search & Depth- last Search

96) The organization and management of data structures take place in:
(a) Primary Memory (b) Secondary Memory
(c) External Memory (d) Primary & Secondary Memory

97) In an expression binary tree, to obtain the postfix form of the expression we

10 | P a g e
traverse in:
(a) Pre order (b) Post order
(c) In order (d) Pre and Post order both

98) Suppose you have a directed graph representing all the flights that an airline flies.
What algorithm might be used to find the best sequence of connections from one
city to another?
(a) Breadth first search. (b) Depth first search.
(c) A cycle-finding algorithm. (d) A shortest-path algorithm.

99) The operation for adding an entry to a stack is traditionally called:


(a) add (b) append
(c) insert (d) push

100) Consider A and B as two operands, and “ +” as the operator, the presentation
A + B is called:
(a) prefix (b) postfix
(c) infix (d) suffix

11 | P a g e
Section B

a) linked list and double linked list (Distinguish)


b) Draw well labeled diagrams for a single linked list and a double linked list for givrn
inputs.
c) Write a code snippet demonstrate insertion and deletion operations in a single linked
list and a double linked list respectively.
D) KNOW THE features of indexing
e) Difference between a hash and an index.
f) Draw a complete graph for given nodes
g) Determine the number of spanning trees
h) Draw all possible spanning trees from a given graph
i) Write the big O for the given code
j) Characteristics of an algorithm.
k) Name the different types of sort.
l) Differentiate between the following categories of algorithm.
m) Complete tables such as

Constant O(1)
Logarithmic O(log n)
Linear O(n)
n log n O(n log n)
Quadratic O(n)
Cubic O(n3)
n). Write the Prefix, Infix and Postfix notation from the expression tree.
o). Briefly define Parent, Path, Leaf
P). KNOW Basic operations that can be performed on a binary search tree.
q). Traverse the given tree using In-order, Pre-order and Post-order traversals.

12 | P a g e

You might also like