T4Tutorials .PK

VU Past Papers CS301 – Midterm Data Structure (Spring 2011, 2010, Fall 2009)

Q1: Which one of the following calling methods does not change the original value of the argument in the calling function?
(A) None of the given options
(B) Call by passing the value of the argument
(C) Call by passing reference of the argument
(D) Call by passing the address of the argument
Answer: (B) Call by passing the value of the argument

Q2: Which one is a self-referential data type?
(A) Stack
(B) Queue
(C) Link list
(D) All of these
Answer: (C) Link list

Q3: AVL Tree is
(A) Non Linear data structure
(B) Linear data structure
(C) Hybrid data structure (Mixture of Linear and Non Linear)
(D) None of the given options
Answer: (A) Non Linear data structure

Q4: We access elements in AVL Tree in
(A) Linear way only
(B) Non Linear way only
(C) Both linear and non linear ways
(D) None of the given options
Answer: (B) Non Linear way only

Q5: “+” is a _____ operator
(A) Unary
(B) Binary
(C) Ternary
(D) None of the above
Answer: (B) Binary

Q6: “–” is a _____ operator
(A) Unary
(B) Binary
(C) Ternary
(D) None of the above
Answer: (A) Unary

Q7: The data of the problem is of 2GB and the hard disk is of 1GB capacity. To solve this problem we should
(A) Use better data structures
(B) Increase the hard disk space
(C) Use the better algorithm
(D) Use as much data as we can store on the hard disk
Answer: (C) Use the better algorithm

Q8: What is the maximum depth of recursive calls a function may make?
(A) 1
(B) 2
(C) n (where n is the argument)
(D) There is no fixed maximum
Answer: (D) There is no fixed maximum

Q9: Suppose n is the number of nodes in a complete Binary Tree. Then maximum steps required for a search operation are
(A) log₂(n+1) – 1
(B) log₂(n+1)
(C) log₂(n) – 1
(D) log₂(n)
Answer: (B) log₂(n+1)

Q10: A binary tree where every node has a value, left subtree contains values ≤ node, and right subtree values ≥ node is called
(A) Strictly Binary Tree
(B) Binary Search Tree
(C) AVL tree
(D) All of these
Answer: (B) Binary Search Tree

Q11: If we delete the value 50 from a binary search tree using standard algorithm, what value will be in the root of the remaining tree?
(A) 50
(B) 60
(C) 70
(D) 80
Answer: (C) 70

Q12: Four statements about trees are below. Three are correct. Which one is INCORRECT?
(A) Trees are recursively defined multi-dimensional data structures
(B) The order of a tree indicates maximum number of children allowed at each node
(C) A search tree is a special type of tree where all values (keys) are ordered
(D) If Tree1’s size is greater than Tree2’s size, then the height of Tree1 must also be greater than Tree2’s height
Answer: (D) If Tree1’s size is greater than Tree2’s size, then the height of Tree1 must also be greater than Tree2’s height

Exit mobile version