CS301- Data Structures MIDTERM EXAMINATION Spring 2010

MIDTERM EXAMINATION Spring 2010

Question No: 1 ( Marks: 1 ) - Please choose one
In an array we can store data elements of different types.
► True
► False (Page 7)


Question No: 2 ( Marks: 1 ) - Please choose one
In an array list the current element is
► The first element Click here for detail
► The middle element
► The last element
► The element where the current pointer points to


Question No: 3 ( Marks: 1 ) - Please choose one
Which one of the following calling methods does not change the original value of the argument in the calling function?
None of the given options
Call by passing the value of the argument Click here for detail
► Call by passing reference of the argument
► Call by passing the address of the argument


Question No: 4 ( Marks: 1 ) - Please choose one
Which one of the following statements is NOT correct?
► Array size can be changed after its creation. Click here for detail
Link List size can be changed after its creation
► Binary Search Tree size can be changed after its creation
AVL Tree size can be changed after its creation





Question No: 5 ( Marks: 1 ) - Please choose one
Suppose that the class declaration of SomeClass includes the following function prototype. bool LessThan( SomeClass
anotherObject );
Which of the following tests in the client code correctly compares two class objects alpha and beta?
► if (alpha < beta)
► if (alpha.LessThan(beta))
► if (LessThan(alpha, beta))
► if (LessThan(alpha).beta)


Question No: 6 ( Marks: 1 ) - Please choose one
A queue is a----- data structure, whereas a stack is a -----data structure.
► FIFO, LIFO (Page 161,54)
LIFO,FIFO
► none of these
► both of these


Question No: 7 ( Marks: 1 ) - Please choose one
Which one of the following operators has higher priority than all of others?
► Multiplication operator
► Minus operator
Plus operator
► Exponentiation operator


Question No: 8 ( Marks: 1 ) - Please choose one
Each node in Binary Search Tree has
► 1 pointer
► 2 pointers
► 3 pointers
► 4 pointers


Question No: 9 ( 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 tree
► The order of a tree indicates a maximum number of children allowed at each node of the
► 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 Tree2's height. Click here for detail

Question No: 10 ( Marks: 1 ) - Please choose one
Which of the following is "TRUE" about arrays,
► We can increase the size of arrays after their creation.
► We can decrease the size of arrays after their creation.
► We can increase but can't decrease the size of arrays after their creation.
► We can neither increase nor decrease the array size after their creation.


Question No: 11 ( Marks: 1 ) - Please choose one
Searching an element in an AVL tree take maximum in AVL tree,
Log2(n+1)
time (where n is no. of nodes
Log2(n+1) -1
► 1.44 Log2n (Page 227)
► 1.66 Log2n



Question No: 12 ( Marks: 1 ) - Please choose one
There is/are case/s for rotation in an AVL tree,
►1
►3
►2
►4(Page 229)


Question No: 13 ( Marks: 1 ) - Please choose one
Consider the following statements.
(i) A binary tree can contain at least 2L Nodes at level L.
(ii) A complete binary tree of depth d is a binary tree that contains 2L Nodes at each level L
between 0 and d, both inclusive.
(iii) The total number of nodes (Tn ) in a complete binary tree of depth d is 2 d+1 - 1 .
(iv) The height of the complete binary tree can be written as h = log 2 (Tn+1)-1 where Tn is
Total number of Nodes.
Which one of the following is correct in respect of the above statements regarding the Binary trees?
► (i) and (iii) only
► (i), (ii) and (iii) only
► (ii) and (iii) only
► (ii), (iii) and (iv) only Click here for detail



Question No: 14 ( Marks: 1 ) - Please choose one
Consider the following infix expression.
5 + 6/2
If one converts the above expression into postfix, what would be the resultant expression?
► 56/ + 2
►562/+ (Page 66)
►56/2+
► /62 + 5



Question No: 15 ( Marks: 1 ) - Please choose one
Which of the following is a non linear data structure?
Linked List
► Stack
Queue
► Tree(Page 112)



Question No: 16 ( Marks: 1 ) - Please choose one
“+” is a operator.
Unary
► Binary (Page 64)
► Ternary
None of the above






No comments:

Post a Comment