Users Also Read

MCQ's Search Engine

Electrical Engineering

Mechanical Engineering

Civil Engineering

Automobile Engineering

Chemical Engineering

Computer Engineering

Electronics Engineering

Medical Science Engg

Q1. | Which of the following algorithms solves the all-pair shortest path problem? |

A. | Floyd's algorithm [Correct Answer] |

B. | Prim's algorithm [Wrong Answer] |

C. | Dijkstra's algorithm [Wrong Answer] |

D. | Warshall's algorithm [Wrong Answer] |

View Answer
Explanation:-
Answer : ADiscuss it below :!! OOPS Login [Click here] is required to post your answer/resultHelp other students, write article, leave your comments |

**Also Read Similar Questions Below :**

⇒ Number of "ADD" and "REMOVE" operations required to access n/2th elements of a queue of "n" elements so that the original queue remain the same after the access is (take help of another queue.)

2*n

4*n

8*n

8*n-1

⇒ 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

Has exactly 17 nodes

Has exactly 19 nodes

Cannot have more than 19 nodes

None of these

⇒ Which of the following statements is false ?

A tree contains a cycle

A tree is a connected graph

Every tree is a bipartite graph

A tree with n nodes contains n-1 edges

⇒ 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

heap sort

bubble sort

selection sort

insertion sort

⇒ A full binary tree with n non-leaf nodes contains

2n nodes

n - 1 nodes

log2n nodes

2n + 1 nodes

⇒ A binary tree of depth "d" is an almost complete binary tree if

for any node

each leaf in the tree is either at level

both (a) and (b)

None of these

⇒ If the binary search algorithm determines that the search argument is in the lower half of the array, which of the following statements will, set the appropriate variable to the appropriate value?

stop Sub = middle Sub - 1;

stop Sub = middle Sub + 1.

start Sub = middle Sub - 1;

start Sub = middle Sub + 1;

⇒ In previous question, the average access time will be

248 units

258 units

268 units

278 units

⇒ The maximum number of comparisons needed to sort 7 items using radix sort is (assume each item is 4 digit decimal number)

23

110

280

450

⇒ Traversing a binary tree first root and then left and right subtrees called _______traversal.

inorder

preorder

postorder

none of these

⇒ Which of the following best describes sorting ?

Adding a new record to the data structure

Arranging the data (record) in some given order

Finding the location of the record with a given key

Accessing and processing each record exactly once

⇒ Stack is useful for implementing

Radix

Recursion

Breadth first search

None of these

⇒ The depth of a complete binary tree with 'n nodes is (log is to be base two)

log(n)

log(n) + 1

log (n-1) + 1

log (n+1)-1

⇒ Which of the following algorithms solves the all-pair shortest path problem?

Floyd's algorithm

Prim's algorithm

Dijkstra's algorithm

Warshall's algorithm

⇒ Sorting is useful for

report generation

responding toe queries easily

making searching easier and efficient

All of these

⇒ For a linear search in an array of n elements the time complexity for best, worst and average case are ......., ....... and ........ respectively

O(1),O(n) and O(n)

O(1), O(n) and O(n/2)

O(n), O(1), and O(n/2)

O(1), O(n) and (n-1/2)

⇒ Which of the following permutations can be obtained in the output(in the same order),using a stack assuming that the input is the sequence 1,2,3,4,5 in that order?

1,5,2,3,4

3,4,5,2,1

3,4,5,1,2

5,4,3,2,1

⇒ Which of the following is useful in implementing quick sort?

set

List

Stacks

Queue

⇒ Which one of the following statements is false?

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 tree cannot be uniquely reconstructed.

Both (a) and (b)

Optimal binary search tree construction can be performed efficiently using dynamic programmmg.

⇒ A full binary tree with n leaves contains

n nodes

2n nodes

2n - 1 nodes

log (n+1) nodes

⇒ The way a card game player arranges his cards as he picks them up one by one, is an example of

merge sort

bubble sort

selection sort

insertion sort

⇒ The number of nodes in a complete binary tree of level 5 is

10

21

63

77

⇒ Which of the following expressions accesses the (i,j)th entry of an (m x n) matrix stored in column major form?

m x(j -1) + i

n x(m-i) + j

n x (i -1) + j

m x (n-j) + j

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

n

n+1

n-1

2n-1

⇒ Let m, n be positive integers. Define Q (m, n) as Q (m, n) = 0, if m>n Then Q (m, 3) is (a div b, gives the quotient when a is divided by b)

3 x p

a constant

p x (m div 3)

p x (m mod 3)

⇒ The concept of order (Big O) is important because

it can be used to decide the best algorithm that solves a given problem

it determines the maximum size of a problem that can be solved in a given system, in a given amount of time

all of the above

none of these

⇒ The running time of an algorithm is given by T(n) = T(n - 1) + T(n - 2) - T(n - 3), if n > 3 n, otherwise.

n

log n

n+1

None of these

⇒ Stack is useful for implemeting

recursion

depth first search

both (a) and (b)

breadth first search

⇒ The data structure required to evaluate a postfix expression is

Stack

Queue

Array

linked-list

⇒ Which of the following sorting procedure is the slowest ?

Shell sort

Heap sort

Quick sort

Bubble sort