VU CS301 -Data Structure MIDTERM Solved/Unsolved Papers Spring 2009
Question No: 1 ( Marks: 1 ) – Please choose one
Which one of the following is a valid postfix expression?
► abc*+d- (According to rule)
Question No: 2 ( Marks: 1 ) – Please choose one
The tree data structure is a
► Linear data structure
► Non-linear data structure (Page 112)
► Graphical data structure
► Data structure like queue
Question No: 3 ( Marks: 1 ) – Please choose one
A Compound Data Structure is the data structure which can have multiple data items of same type or of different types.Which of the following can be considered compound data structure?
► Arrays Click here for detail
► Binary Search Trees
► All of the given options
Question No: 4 ( Marks: 1 ) – Please choose one
Suppose a pointer has been declared in main but has not assigned any variable address then ►That pointer points to First byte in main function
►That pointer contains a NULL value
►None of these
►That pointer points to any memory address
Question No: 5 ( Marks: 1 ) – Please choose one
Here is the start of a C++ class declaration:
void x(foo f);
void y(const foo f);
void z(foo f) const;
Which of the three member functions can alter the PRIVATE member variables of the foo object that activates the function?
►Only x can alter the private member variables of the object that activates the function.
►Only y can alter the private member variables of the object that activates the function.
►Only z can alter the private member variables of the object that activates the function.
►Two of the functions can alter the private member variables of the object that activates the function.
Only the x and y can alter the private member variable of the foo class object. Last Option is more correct but not exact. In the last option the two function name are not mentioned
Question No: 6 ( Marks: 1 ) – Please choose one
The operation for removing an entry from a stack is traditionally called: ► delete
► pop (Page 53)
Question No: 7 ( Marks: 1 ) – Please choose one
Which statement of the following statements is incorrect? ► Lists can be implemented by using arrays or linked lists ► A list is a sequence of one or more data items
► Stack is a special kind of list in which all insertions and deletions take place at one end
► Stacks are easier to implement than lists
Question No: 8 ( Marks: 1 ) – Please choose one
Parameters in function call are passed using,
► Stack (Page 80)
► Binary Search Tree
► AVL Tree
Question No: 9 ( Marks: 1 ) – Please choose one
Consider the following sequence of push operations in a stack: stack.push(’7’);
►7 8 9 10 11 12
►9 8 11 10 7 12
►9 10 8 11 12 7
►9 10 8 12 7 11
Question No: 10 ( Marks: 1 ) – Please choose one
What is the maximum depth of recursive calls a function may make?
► n (where n is the argument)
► There is no fixed maximum
Question No: 11 ( Marks: 1 ) – Please choose one
Consider the following function:
void test_a(int n)
cout << n << ” “;
What is printed by the call test_a(4)?
► 4 2 0
► 0 2 4
► 0 2
► 2 4
Question No: 12 ( Marks: 1 ) – Please choose one
► Last in First out
► First in Last out
► First in First out (Page 87)
► None of these
Question No: 13 ( Marks: 1 ) – Please choose one
is a binary tree where every node has a value, every node’s left subtree contains only values less than or equal to the node’s value, and every node’s right subtree contains only values that are greater then or equal ?
►Strictly Binary Tree
►Binary Search tree Click here for detail
►All of these
Question No: 14 ( Marks: 1 ) – Please choose one
Four statements about trees are below. Three of them are correct. Which one is INCORRECT?
►Trees are recursively defined multi-dimensional data structures Click here for detail
►The order of a tree indicates a maximum number of childen allowed at each node of the tree ►A search tree is a special type of tree where all values (i.e. keys) are ordered
►If Tree1’s size is greater than Tree2’s size, then the height of Tree1 must also be greater than
Question No: 15 ( Marks: 1 ) – Please choose one
Below is a binary search tree. If we delete the value 50 using the algorithm we discussed, what value will be in the root of the remaining tree?
Question No: 16 ( Marks: 1 ) – Please choose one
Is a data structure that can grow easily dynamically at run time without having to copy existing elements? ► Array
► Both of these
► None of these