The maximum number of comparisons needed to sort 7 items using radix sort is (assume each item is a 4 digit decimal number)
280
40
47
38
If each node in a tree has a value greater than every value in its left sub tree and has value less than every value in its right sub tree, the binary tree is known as
Complete binary tree
Full binary tree
Binary search tree
Threaded binary tree
A binary tree in which if all its levels except possibly the last, have the maximum number of nodes and all the nodes at the last level appear as far as possible, is known as
full binary tree
2-tree
threaded tree
Complete binary tree
You are asked 15 randomly generated numbers. You should prefer
bubble sort
quick sort
merge sort
heap sort
Which data structure is needed to convert infix notation to post fix notation
B-tee
Queue
Tree
Stack
The time required to search an element in a binary search tree having n elements is
O(1)
O(log2 n)
O(n)
O(n log2 n)
A binary tree T has n leaf nodes. The number of nodes of degree 2 in T is
log2 n
n-1
n
2n
A tree, for which at every node the height of its left sub tree and right sub tree differ at most by one is a/an
Binary search tree
AVL tree
Complete binary tree
Threaded binary tree
Which of the following sorting algorithms does not have a worst case running time complexity of O(n2)?
Insertion sort
Merge sort
Quick sort
Bubble sort
Which of the following is not a correct statement
internal sorting is used if the number of items to be sorted is very large
External sorting is used if the number of items to be sorted is very large
External sorting needs auxiliary storage
Internal sorting needs auxiliary storage
There are 4 different algorithms A1,A2,A3,A4 to solve a given problem with the order log(n),log(log(n)),nlog(n),n/log(n) respectively. Which is the best algorithm?
A1
A2
A3
A4
Which of the following algorithms exhibits the unusual behavior that, minimum numbers of comparisons are needed if the list to be sorted is in the reverse order and maximum numbers of comparisons are needed if they are already in sorted order?
Heap tree
Radix sort
Binary insertion sort
Selection sort
You want to check whether a given set of items is sorted. Which of the following sorting methods will be the most efficient if it is already in sorted order?
bubble sort
selection sort
insertion sort
merge sort
The way a card game player arranges his cards as he picks them up one by one , is an example of
bubble sort
selection sort
insertion sort
merge sort
Which of the following sorting algorithm has the worst time complexity of nlog(n)?
Heap sort
Quick sort
Insertion sort
Selection sort
Which of the following sorting methods sorts a given set of items that is already in sorted order or in reverse sorted order with equal speed?
Heap sort
Quick sort
Insertion sort
Selection sort
Which of the following sorting methods will be the best if number of swapping done, is the only measure of efficiency?
bubble sort
insertion sort
selection sort
heap sort
As part of the maintenance work, you are entrusted with the work of rearranging the library books in a shelf in proper order, at the end of each day. The ideal choice will be
bubble sort
insertion sort
selection sort
heap sort
Sorting is not useful for
report generation
minimizing the storage needed
making searching easier and efficient
responding to queries easily
A machine took 200 sec to sort 200 names, using bubble sort. In 800 sec. it can approximately sort _ _ _ _ _ _ _ _ _ names
400
800
750
1600
A sorting method with _ _ _ _ _ _ _ _ is the most efficient method
O(log n)
O(n)
O(1)
O(n2)
Which of the following statement is false?
Optimal binary search construction can be performed efficiently using dynamic programming
Breadth-first search cannot be used to find connected components of a graph
Given the prefix and postfix walks of a binary tree, the binary cannot be uniquely reconstructed
Depth-first search can be used to find the connected components of a graph
The average successful search time for sequential search on ‘n’ items is
n/2
(n-1)/2
(n+1)/2
log(n)+1
A hash function f defined as f(key)=key mod 7, with linear probing, is used to insert the keys 37,38,72,48,98,1,56, into a table indexed from 0 to 6. What will be the location of key 11?
3
4
5
6
The order of the binary search algorithm is
n
n2
nlog(n)
log(n)
Linked lists are not suitable for implementing
insertion sort
binary search
radix sort
polynomial manipulation
Stack is useful for
radix sort
breadth first search
heap sort
depth first search
Which of the following algorithm design technique is used in the quick sort algorithm?
Dynamic programming
Backtracking
Divide and conquer
Greedy method
A 3-ary tree in which every internal node has exactly 3 children. The number of leaf nodes in such a tree with 6 internal nodes will be
10
17
23
13
Which of the following traversal techniques lists the nodes of a binary search tree in ascending order?
post-order
In-order
Pre-order
No-order
A general linear list is a list in which operations, such as retrievals, insertions, changes, and deletions can be done _ _ _ _ _ _ _ _ _
any where in the list
only at the beginning
only at the end
only at the middle
A(n) _ _ _ _ _ _ _ is a collection of elements and relationship Among them.
abstract data type
array
data structure
standard type
Data that consists of a single, non decomposable entity are known as _ _ _ _ _ _
atomic data
array
data structure
standard type
A binary tree has n leaf nodes. The number of nodes of degree 2 in this tree is
logn
n-1
n
2n
A full binary tree with n leaf nodes contains
n nodes
log2 n nodes
2n-1 nodes
2n nodes
The number of binary trees with 3 nodes which when traversed in post-order gives the sequence A,B,C is
3
9
7
5
Which of the following need not be a binary tree?
Search tree
Heap
AVL-tree
B-tree
A binary tree in which every non-leaf node has non-empty left and right subtrees is called a strictly binary tree.Such a tree with 10 leaves
cannot be more than 19 nodes
has exactly 19 nodes
has exactly 17 nodes
can not have more than 17 nodes
Find the odd man out
binary tree
Avl tree
graph
queue
The depth of a complete binary tree with n nodes(log is to the base two)
log(n+1)-1
log(n)
log(n+1)+1
log(n)+1
The following is an example of a non-linear data structure
stack
queue
tree
linear list
If a graph is represented as a linked list, _ _ _ _ _ _ _ _ _ no.of list nodes are required
1
2
3
4
The number of possible binary trees with 4 nodes is
12
14
13
15
The number of possible binary trees with 3 nodes is
12
13
5
15
The number of possible ordered trees with 3 nodes A,B,C is
16
12
6
10
A tree is a _ _ _ _ _ data structure
non-recursive
recursive
linear
non-linear
A node that does not have any sub-tree is called a _ _ _ _ _ _ _
terminal node
root node
left node
right node
The number of edges in a regular graph of degree d and n vertices is