Algorithms Quiz



Algorithms Quiz at csepedia.org

1. The pre-order and post order traversal of a Binary Tree generates the same output. The tree can have maximum

A. Three nodes
B. Two nodes
C. One node
D. Any number of nodes


2. The searching technique in which there are no unnecessary comparisons is called

A. Binary searching
B. Sequential searching
C. Hashing
D. None of these


3. Which of the following sorting procedures is the slowest?

A. Quick sort
B. Heap sort
C. Shell sort
D. Bubble sort


4. If every node u in G is adjacent to every other node v in G, A graph is said to be

A. Isolated
B. Complete
C. Finite
D. Strongly Connected


5. In order to get the information stored in a Binary Search Tree in the descending order, one should traverse it in which of the following order?

A. Left, Root, Right
B. Root, Left, Right
C. Right, Root, Left
D. Right, Left, Root


6. In a Heap tree

A. Values in a node is Greater than every value in Left Sub Tree
           and Smaller than Right Sub Tree
B. Values in a node is Greater than every value in children of it
C. Both of above conditions applies
D. None of above conditions applies


7. If any undirected graph ,the sum of degrees of all the nodes

A. Need not be even
B. Must be odd
C. Is twice the number of edges
D. Must be even


8. A Graph in which all nodes are of equal degree is called

A. Multi Graph
B. Non Regular Graph
C. Regular Graph
D. Complete Graph


9. What is the postfix form of the following prefix *+ab–cd

A. ab+cd–*
B. abc+*–
C. ab+*cd–
D. ab*+cd–


10. The most common Hash functions use the__________to compute hash address.

A. Union method
B. Subtraction method
C. Division method
D. None of the above


11. The Data Structure required for Breadth First Traversal on a Graph is

A. Queue
B. Stack
C. Array
D. Tree


12. The balance factor for an AVL tree is either

A. –2,–1 or 0
B. 0,1 or –1
C. 0,1 or 2
D. All the above


13. The Time Factor when determining the efficiency of algorithm is measured by

A. Counting microseconds
B. Counting the number of key operations
C. Counting the number of statements
D. Counting the kilobytes of algorithm


14. The Inorder traversal of the tree will yield a sorted listing of elements of tree in

A. Binary Tree
B. Heaps
C. Binary Search Tree
D. None of the above


15. Sparse matrices have

A. Many zero entries
B. Many non zero entries
C. Higher dimension
D. None of the above


16. Which of the following algorithms solves the All Pair Shortest Path problem?

A. Dijkstra algorithm
B. Floyd algorithm
C. Prim algorithm
D. Warshall algorithm


17. A Sorting technique that guarantees,that records with the same primary key occurs in the same order in the sorted list as in the original unsorted list is said to be

A. Stable
B. Consistent
C. External
D. Linear


18. Hashing Collision Resolution Techniques are

A. Huffman Coding, Linear Hashing
B. Bucket Addressing, Huffman Coding
C. Chaining, Huffman Coding
D. Chaining, Bucket Addressing


19. Given a binary tree whose inorder and preorder traversal are given by

Inorder : EICFBGDJHK
Preorder : BCEIFDGHJK
The post order traversal of the above binary tree is

A. IEFCGJKHDB
B. IEFCJGKHDB
C. IEFCGKJHDB
D. IEFCGJKDBH


20. Consider a Linked List of n elements. What is the time taken to insert an element after an element pointed by some pointer?

A. O (1)
B. O (n)
C. O (log2 n)
D. O (n log2 n)




CSE Quiz

Algorithms




Database Management




C++ Quiz 1

C++ Quiz 2




Digital Electronics





Data Structures




Computer Architecture




Computer Network




HTML





Automata Theory




Operating System