When we say the order of a tree is M, we mean that every non-leaf node must have M subtrees.

►

True

►

False

Question No: 2( Marks: 2 )-Please choose one

The time complexity of an ordered list of inserting/deleting a data item to/from the list is O(length_of_list*length_of_list)

►

True

►

False

Question No: 3( Marks: 2 )-Please choose one

An unbalanced tree is one whose root has many more left descendents than right descendents

►

True

►

False

Question No: 4( Marks: 2 )-Please choose one

Stack and queue data structures are needed to convert the infix notations to post fix notations.

►

True

►

False

Question No: 5( Marks: 2 )-Please choose one

A sequential search of the elements is faster than the binary search of an ordered set of elements in an array.

►

True

►

False

Question No: 6( Marks: 10 )

Convert the infix expression (A - B) * C + D to postfix. Show the trace of the algorithm, i.e., the stack, the infix expression and postfix expression.

Question No: 7( Marks: 10 )

Given two sorted lists, L_{1} and L_{2}, Write the following routine to compute L_{1} ∩ L_{2} using only the basic list operations.

List intersection(List list1, List list2){

// Write the complete code to compute L_{1} ∩ L_{2 }here.

}

Question No: 8( Marks: 10 )

Consider a binary search tree (BST) that is initially empty. Draw the tree that will result if the following numbers are inserted in the order given: 35, 28, 13, 43, 30, 89, 38, 16, 12, 40

Question No: 9( Marks: 10 )

Consider the following binary tree:

(a) Starting from the root node, perform an In-order traversal of the binary tree below and write the letters in the nodes that will result during the visitations.

(b) Write the nodes if a Pre-order traversal is performed starting with node O.

## No comments:

Post a Comment