Tuesday, May 26, 2015

Data Structure Multiple Choice Questions with Answers...

The primary address of the first element of an array is called

1.floor address

2.foundation address

3.first address

4.base address

The main measures for the efficiency of an algorithm are

1.processor and memory

2.complexity and capacity

3.time and space

4.data and space

time factor when determining the efficiency of algorithm is measured by

1.counting micro seconds

2.counting the number of key operations

3.counting the number of statements

4.counting the kilo bytes of algorithm

The space factors when determining the efficiency of algorithm is measured by

1.counting the maximum memorey needed by the algorithm

2.counting the minimum memorey needed by the algorithm

3.counting the average memeory needed by the algorithm

4.counting the maximum disk space needed by the algorithm

Which of the following cases does not exist in complexity theory

1.Best case

2.worst case

3.average case

4.Null case

The worst case occur in linear search algorithm when

1.Itme is some where in the middle of the array

2.item is not in the array at all

3.item is in the list element in the array

4.item is the last element in the array or is not there at all

The complexity of linear search algorithm is

1.O(n)

2.O(log n)

3.O(n2)

4.O(n log n)

The complexity of binary search algorithm is

1.O(n)

2.O(log n)

3.O(n2)

4.O(n log n)

which of the following data structures is not linear data structure

1.Arrays

2.linked lists

3.both (a) and (b)

4.none of these

The operations of processing each element in the list is known as

1.sorting

2.merging

3.inserting

4.traversal

Linked list are best suited

1.for relatively permanent collection of data

2.for the size of the structure and the data to the strcuture are constantly changing

3.both (a) and (b)

4.none of the above

the memory address of fifth element of an array can be calculated by the formula

1.LOC ( array[5] = Base (array) + w( 5-lower bound)

2.LOC ( array[5] = Base (array[5] + ( 5 - lowerbound)

3.LOC (array[5] = base [array[4]) + (5 - lower bound)

4.none of the above

If h is any hashing function and is used to hash n keya into a table of size m, where n <= m , the

expected number of collections involving a particular key x is

1.less than 1

2.less than n

3.less than m

4.less than m/2

Let A be an adjacency matrix of a graph G, the ijth entry in the matriz A power k gives

expected number of collections involving a particular key x is

1.the number of paths of length is k from vertex vi to vertex vj

2.shortest path of k edges from vertex vi to vertex vj

3.length of a Eulerian path from vertex vi to vj

4.length of a hamiltonian cycle from vertex vi to vj

The OS of a computer may periodically collect all the free memory space to form contiguous block of free space

This is called

1.concatenation

2.garbage collection

3.collision

4.dynamic memory allocation

you have to sort a list L consisting of a sorted list followed by a new randon elements which of the

following sorting methods would be especially suitable for such a task

1.Bubble sort

2.selection sort

3.quick sort

4.Insertion sort

B-trees are generally

1.very deep and marrow

2.very wide and shallow

3.very deep and very wide

4.can not say

A technique for direct search is

1.binary search

2.linear search

3.tree search

4.hashing

If a node having two children is deleted from a binary tree, it is replaced by its

1.inorder performance

2.inorder successor

3.preorder predecessor

4.none of these

The searching technique tht takes O(1) time to find a data

1.linear search

2.binary search

3.hashing

4.tree search

The number of interchanges required to sort 5,1,6,2, and 4 in ascending order using bubble sort is

1.6

2.5

3.7

4.8

the prefix for a string is ABC+-D*, the actual string will be

1.( A - ( B + C)) * D

2.((A - B) + C) * D)

3.(( A + B ) - C ) * D

4.( A + ( B - C )) * D

The post fix from of the expression ( A + B) * ( C * D - E) * F / G is

1.AB + CD * E - FG / * *

2.AB+CD*E - F ** F/

3.AB+CD*E - *F*G/

4.AB+CDE* - *F*G/

The algorithm that will efficiently sort an array that is neatly sorted except for the interchange

of some adjacent pairs of numbers like { 1,3,2,5,4,6} is

1.quick sort

2.bubble sort

3.merge sort

4.selection sort

What is the time required to insert an element in a stack with linked implementation

1.O(log 2 n)

2.O(n)

3.O(n log 2 n )

4.O(1)

Which of the following is false

1.Every time is a bipetite graph

2.A tree consists a cycle

3.A tree with a nodes contain's n-1 edges

4.A tree is a connected graph

For an indirected graph with n vertices and e edges , the sum of the degree of each vertex is

1.2n

2.(2n-1)/2

3.2e

4.e2/2

In worst case , quick sort has order of complexity

1.o(n log n)

2.O( n 2 / 2)

3.O(log n)

4.(n 2 / 4)

A full binary tree with ( 2 n + 1 ) nodes contain

1.n leaf nodes

2.n non leaf nodes

3.(n-1) leaf nodes

4.non-leaf nodes

which two of the following are equivalent for an undirected graph

(i) G is a tree (ii) There is atleast one path between any two distinct vertices of a

(iii) F contains no cycles and has (n - 1 ) edges

1. i and ii

2. ii and iii

3. ii and iv

4.ii and iii

If a node in a BST has two children , then its inorder predecessor has

1.no left child

2.no right child

3.two children

4.no child

A linear list of elements in which deletion can be done from one end ( from) and insertion

can take place only at another end (rear) is known as a

1.queue

2.stack

3.tree

4.linked list

What is the post fix form of the following prefix expression

A/B * C $ D E

1.ABCDE$*/-

2.A-BCDE$*/-

3.ABC$ED*/-

4.A-BCDE$*/

If a node in a BST has two children , then its inorder predecessor has

1.no left child

2.no right child

3.two children

4.no child

A full binary tree with n leaves contains

1.n nodes

2.log 2 n nodes

3.2 n - 1 nodes

4.2 n nodes

Which of the following sorting algorithms does not have a worst case running time of D(n2)

1.insertion sort

2.merge sort

3.quick sort

4.bubble sort

An undirected graph G with n vertices and e edges is represented by adjacency list. What is the time

required to generate all the connected components

1.O(n)

2.O(e)

3.O( e + n)

4.O(e 2)

Queue is a __________ list

1.LIFO

2.LILO

3.FILO

4.FIFO

Consider the linked list of n elements. what is the time take to insert an element after the element

printed by some pointer

1.O(1)

2.O(log 2 n)

3.O(n)

4.O(n log 2 n)

In a circular linked list

1.components are all linked together in some sequential manners

2.there is no begining and no end

3.components are arranged hierarchically

4.forward and backward traversal within the list is permitted

In a heap every element is _______ of all the elements in the sub tree

1.maximum

2.minimum

3.sum

4.product

if ( rear == maxmize - 1) rear = 0 , else rear = rear + 1 is required in

1.circular queue

2.linear queue

3.stack

4.dqueue

How much extra space is used by heap sort

1. O(1)

2.O(log n )

3.O(n)

4.O(n 2)

The maximum degree of any vertex in a simple graph, with n vertices is

1. n-1

2.n+1

3.2n-1

4.n

The data structure required for breadth first traversal on a graph is

1. queue

2.stack

3.array

4.tree

The queue sort algoithm explicit ________ design technique

1. greedy

2.dynamic programming

3.divide and conquer

4.back tracking

The number of different directed trees with 3 nodes are

1. 2

2.3

3.4

4.5

One can convert a binary tree into its mirror image by traversing it in

1.inorder

2.preorder

3.postorder

4.anyorder

The data structure required to evaluate a postfix expression is

1.queue

2.stack

3.array

4.linked list

Which of the following statement is true

1.Every tree is not a bipartite graph

2.A tree does not contain a cycle

3.A tree with nodes contains (n-1) edges

4.A tree is not a connected graph

A tree is not a connected graph

1.depth first order

2.breadth first order

3.topological order

4.linear order

The number of edges in a complete graph of n vertices is

1.n

2.n(n-1) / 2

3.n(n+!) / 2

4.n 2 / 2

The data structure required to check wheather an expression contains balanced paranthesis is

1.stack

2.queue

3.tree

4.array

A linear collection of data, where element the linear node is given by means of pointer,

is called

1.linked list

2.node list

3.premitive list

4.none of these

Which of the following is true for binary search tree

1.It gives the ascending order for preorder traversal

2.It gives the ascending order for inorder traversal

3.It gives the descending order for postorder traversal

4.It gives the descending order for preorder traversal

Which of the following is true for walk in a graph

1.edges are not repeated

2.edges may be repeated

3.all nodes many be covered

4.none of the above

Which one of the following is a physical data structure

1.array

2.linked lists

3.stacks

4.tables

What is the time require to insert an element in a stack with linked implementation

1.O(log 2 n)

2.O(n)

3.O(n log 2 n)

4.O(1)

binary search tree is an example of

1.divide an conquer technique

2.greedy algorithm

3.back tracking

4.dynamic programming

Which algorithm has same average worst case and best case time

1.binary search

2.maximum of a number

3.quick sort

4.fionacci search

Which of the following data structure its used to implement recursion

1.arrays

2.stacks

3.queues

4.linked list

The height of a binary tree with a nodes , in the worst case is

1.O(log n)

2.O(n)

3.omega (n log n)

4.omega (n2)

what is the maximum number of nodes in a B-tree of order 10 of depth B

1.111

2.999

3.9999 (n log n)

4.None of these (n2)

A binary tree with 27 nodes has __________ null branches

1.54

2.27

3.26

4.none of these

The time complexity to build a heap of a elements is

1.O(1)

2.O(log n)

3.O(n)

4.O(n log n)

Linear probing suffers from a problem known as

1.secondary clustering

2.primary clustering

3.both (a) and (b)

4.None of these

Linear probing suffers from a problem known as

1.secondary clustering

2.primary clustering

3.both (a) and (b)

4.None of these

which of the following can be time sequence of nodes examined in binary search tree

while searching for key 88

1.90,40,65,50,88

2.90,110,80,85,88

3.190,60,90,85,88,

4.65,140,80,70,88

In what tree , for every node the height of its left sub tree and right subtree

differ atleast by one

1.binary search tree

2.AVL tree

3.threaded binary tree

4.complete tree

The initial configuration of queue in a,b,c,d,e is at the front. To get the configuaration

d,c,b,a how many deletions and additions required

1.2 deletions, 3 additions

2.3 deletions, 2 additions

3.3 deletions , 4 additions

4.3 deletions, 3 additions

which traversal technique lists the nodes of a binary search tree in ascending order

1.post order

2.inorder

3.preorder

4.linear order

The smallest number of keys that will force a B-tree of order 9 to have a height 3 is

1.12

2.10

3.7

4.None of these

A linked binary tree with a nodes n >= 0 has exactly

1.(2n+1) NULL links

2.(2n-1) NULL links

3.(n+1) NULL links

4.(n-1) NULL links

The bese sorting method, if numbers of swappings done, is the only measure of efficiency is

1.quick sort

2.insertion sort

3.selection sort

4.bubble sort

which one of the following is false about a strictly binary tree

1.A binary tree is called strictly binary tree , if every non leaf node of it has non-empty left and right sub tree

2.A complete binary tree of depth of d is the strictly binary tree all of where leaves are at level d

3.A strictly binary tree with a leaves always contains 2(n-1) nodes

4.All the nodes of strictly binary tree of depth d must be at level d

How many swaps are required to extract the maximum element form the below max-heap

< 16,15,14,6,8,12,13,7>

1.zero

2.1

3.2

4.3

The keys 1,5,28,19,15,20,33,12,17,10 are inserted into a hash table in which collision

resolution is done by chaining. If the hash function , h(k) = k mod 4 and what is the

length of the longest chain

1.1

2.2

3.3

4.4

Given , the hash function h(k) = l mod 3 , what is the numver of collisions to store the following

sequence of keys 15,11,34,10,98,51,37,14,16,47

1.2

2.3

3.9

4.7

Let the following circular queue can accomodate maximum six elements with the following data

front = 2 rear =4 queue = L.M.N...

what will happen when odd operation takes place

1.Front =2 queue=... mar =5 L,M,N,O... rear = 3

2.Front =3 rear=4 queue=..... L,M,N,Q....

3.Front =3 rear=4 queue = L,M,N,Q....

4.Front=2 rear =4 queue = L,M,N,O....

what is the postfix form of the following prefix *+ab-ad

1.ab+ad-*

2.ab+d*-

3.ab+ad-

4.ab+*ad-

which of the following data structure is most efficient in terms of both space and time to reverse a string of characters

1.Linked list

2.stack

3.array

4.tree

which of the following data structure is most efficient in terms of both space and time to reverse a string of characters

1.Linked list

2.stack

3.array

4.tree

which of the following can be the sequence of nodes examined in a binary search tree while searching for key 98

1.100,50,75,60,98

2.100,120,90,95,98

3.200,70,100,96,98

4.75,150,90,80,98

Which of the following is true for a sorting list with a elements

1.insertion in a sorted array takes constant time

2.insertion in a sorted linked list takes constant time

3.searching for a key in a sorted array can be done in O(log n) time

4.searching for a key in a sorted linear linked list can be done in a (log n) time

If a sequence of operations push(1), push(2), pop,push(1), push(2),pop,pop,pop,push(2), pop are performed on a stack

the sequence of popped values are

1.2,2,1,1,2

2.2,2,1,2,2

3.2,1,2,2,1

4.2,1,2,2,2

the way a card game player arranges hits cards as he picks them up one by one , is an

example of

1.bubble sort

2.selection sort

3.insertion sort

4.merge sort

which of the following is useful in implementing heap sort

1.stack

2.set

3.list

4.queue

stack is useful for implementing

1.recursion

2.breadth first search

3.depth first search

4.both (a) and (b)

In a full binary tree, if the transfer of nodes is 15, then the height of the tree is

1.2

2.3

3.4

4.5

what is the most appropriate data structure to implement a priority queue

1.heap

2.circular array

3.linked list

4.binary

A chained hash table has an array size of 100. what is the maximum number of entries that

can be placed in the table

1.100

2.200

3.10000

4.There is no upper limit

If a B-tree of order 5 , the following key are inserted as follows

7,8,1,4,13,20,2,6 and 5

how many elements are present in the root of the tree

1.1

2.2

3.3

4.4

consider a rooted tree in which every node has atleast three children what is the

minimum number of nodes at level i ( i > 0) o the tree Assume that the root is at level 0

how many elements are present in the root of the tree

1.3

2.3i

3.3

4.3i+1

what is the minimum time complexity of covering a given array of integer into a heap

1.O(n)

2.O(n log n)

3.O(log n)

4.O(n2)


No comments:

Post a Comment