Tuesday, August 25, 2009

vu data structures cs301

Welcome to Virtually helps.

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



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)



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

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



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

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



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.



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, L1 and L2, Write the following routine to compute L1 ∩ L2 using only the basic list operations.

List intersection(List list1, List list2){

// Write the complete code to compute L1 ∩ L2 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.

Contact vuhelps@gmail.com

No comments: