AOA dear
i need ur some help in CS301 Quiz if any body know some thing about them than plz solved them some of them i solved bt can't sure... so here are down some quiz so plzzz... on 11 Feb, mera paper hy es subject ka so plz do fast .... me waiting for u people +tive response
and plz high light the correct option in defferent colur....
Question No: 1 (Marks: 1) - Please choose one
Here is a small function definition:
void f(int i, int &k)
{
i = 1;
k = 2;
}
Suppose that a main program has two integer variables x and y, which are given the value 0. Then the main program calls f(x,y); What are the values of x and y after the function f finishes?
► Both x and y are still 0.
► x is now 1, but y is still 0.
► x is still 0, but y is now 2.
► x is now 1, and y is now 2.
Question No: 1 ( Marks: 1 ) - Please choose one
What kind of list is best to answer questions such as "What is the item at position n?"
► Lists implemented with an array.
► Doubly-linked lists.
► Singly-linked lists.
► Doubly-linked or singly-linked lists are equally best
Question No: 16 ( Marks: 1 ) - Please choose one
Suppose that a selection sort of 100 items has completed 42 iterations of the main loop. How many items are now guaranteed to be in their final spot (never to be moved again)?
► 21
► 41
► 42
► 43
Question No: 18 ( Marks: 1 ) - Please choose one
The maximum number of external nodes (leaves) for a binary tree of height H is _________
► 2H
► 2H +1
► 2H -1
► 2H +2
Question No: 22 ( Marks: 1 ) - Please choose one
Suppose A is an array containing numbers in increasing order, but some numbers occur more than once when using a binary search for a value, the binary search always finds ____________
► the first occurrence of a value.
► the second occurrence of a value.
► may find first or second occurrence of a value.
► None of the given options.
Question No: 27 ( Marks: 2 )
Let's call the node as a that requires re-balancing. Consider two cases below:
1) An insertion into right subtree of the left child of a.
2) An insertion into left subtree of the right child of a.
Which of the following statement is correct about the above two cases.
1) The insertion occurs outside (i.e., right to left or left to right) in the above two cases, single rotation can fix the balance in these two cases.
2) The insertion occurs inside ((i.e., right to left or left to right) in these two cases, single rotation cannot fix the balance in these two cases.
Question No: 6 ( Marks: 1 ) - Please choose one
If a complete binary tree has height h then its no. of nodes will be,
► Log (h)
► 2h+1- 1
► Log (h) - 1
► 2h - 1
Question No: 7 ( Marks: 1 ) - Please choose one
If a max heap is implemented using a partially filled array called data, and the array contains n elements (n > 0), where is the entry with the greatest value?
► data[1]
► data[n-1]
► data[n]
► data[2*n+1]
Question No: 8 ( Marks: 1 ) - Please choose one
Which one is a self-referential data type?
► Stack
► Queue
► Link list
► All of these
Question No: 16 ( Marks: 1 ) - Please choose one
Suppose we are sorting an array of eight integers using quick sort, and we have just finished the first partitioning with the array looking like this:
2 5 1 7 9 12 11 10
Which statement is correct?
► The pivot could be either the 7 or the 9.
► The pivot could be the 7, but it is not the 9.
► The pivot is not the 7, but it could be the 9.
► Neither the 7 nor the 9 is the pivot.
Question No: 22 ( Marks: 1 ) - Please choose one
Which formula is the best approximation for the depth of a heap with n nodes?
► log (base 2) of n
► The number of digits in n (base 10), e.g., 145 has three digits
► The square root of n
► n
Question No: 25 ( Marks: 1 ) - Please choose one
Merge sort makes two recursive calls. Which statement is true after these recursive calls finish, but before the merge step?
► Elements in the first half of the array are less than or equal to elements in the second half of the array.
► None of the given options.
► The array elements form a heap.
► Elements in the second half of the array are less than or equal to elements in the first half of the array.
Question No: 3 ( Marks: 1 ) - Please choose one
What will be postfix expression of the following infix expression?
Infix Expression : a+b*c-d
► ab+c*d-
► abc*+d-
► abc+*d-
► abcd+*- (no sure)
Question No: 4 ( Marks: 1 ) - Please choose one
For compiler a postfix expression is easier to evaluate than infix expression?
► True (no sure)
► False
Question No: 14 ( Marks: 1 ) - Please choose one
Merge sort and quick sort both fall into the same category of sorting algorithms. What is this category?
► O(nlogn) sorts
► Interchange sort
► Average time is quadratic
► None of the given options.
Question No: 19 ( Marks: 1 ) - Please choose one
Suppose that a selection sort of 100 items has completed 42 iterations of the main loop. How many items are now guaranteed to be in their final spot (never to be moved again
► 21
► 41
► 42
► 43
Question No: 23 ( Marks: 1 ) - Please choose on
Which of the following statement is NOT correct about find operation:
► It is not a requirement that a find operation returns any specific name, just that finds on two elements return the same answer if and only if they are in the same set.
► One idea might be to use a tree to represent each set, since each element in a tree has the same root, thus the root can be used to name the set.
► Initially each set contains one element.
► Initially each set contains one element and it does not make sense to make a tree of one node only.
Question No: 6 ( Marks: 1 ) - Please choose one
The difference between a binary tree and a binary search tree is that ,
► a binary search tree has two children per node whereas a binary tree can have none, one, or two children per node
► in binary search tree nodes are inserted based on the values they contain
► in binary tree nodes are inserted based on the values they contain
► none of these
Question No: 17 ( Marks: 1 ) - Please choose one
A complete binary tree of height 3 has between ________ nodes.
► 8 to 14
► 8 to 15
► 8 to 16
► 8 to 17
Question No: 21 ( Marks: 1 ) - Please choose one
Which of the following statement is correct about find(x) operation:
► A find(x) on element x is performed by returning exactly the same node that is found.
►A find(x) on element x is performed by returning the root of the tree containing x.
► A find(x) on element x is performed by returning the whole tree itself containing x.
► A find(x) on element x is performed by returning TRUE.
Question No: 6 ( Marks: 1 ) - Please choose one
Suppose that we have implemented a priority queue by storing the items in a heap. We are now executing a reheapification downward and the out-of-place node has priority of 42. The node's parent has a priority of 72, the left child has priority 52 and the node's right child has priority 62. Which statement best describes the status of the reheapification.
► The reheapification is done.
► The next step will interchange the two children of the out-of-place node.
► The next step will swap the out-of-place node with its parent.
► The next step will swap the out-of-place node with its left child.
Question No: 18 ( Marks: 1 ) - Please choose one
Which of the following statement is NOT true about threaded binary tree?
► Right thread of the right-most node points to the dummy node.
► Left thread of the left-most node points to the dummy node.
► The left pointer of dummy node points to the root node of the tree.
► Left thread of the right-most node points to the dummy node.
Question No: 27 ( Marks: 1 ) - Please choose one
A binary tree with 33 internal nodes has _______ links to internal nodes.
► 31
► 32
► 33
► 6
Question No: 7 ( Marks: 1 ) - Please choose one
Compiler uses which one of the following to evaluate a mathematical equation,
►Binary Tree
►Binary Search Tree
►Parse Tree
►AVL Tree
Question No: 8 ( Marks: 1 ) - Please choose one
Which one of the following is TRUE about iteration?
►Iteration extensively uses stack memory.
►Threaded Binary Trees use the concept of iteration.
►Iterative function calls consumes a lot of memory.
►Recursion is more efficient than iteration.
Question No: 21 ( Marks: 1 ) - Please choose one
In a selection sort of n elements, how many times the swap function is called to complete the execution of the algorithm?
► n-1
► n log n
► n2
► 1
Question No: 24 ( Marks: 1 ) - Please choose one
Consider the following postfix expression S and the initial values of the variables.
S = A B - C + D E F - + ^
Assume that A=3, B=2, C=1, D=1, E=2, F=3
What would be the final output of the stack?
► 1
► 2
► 0
► -1
--
--
--
We say, "Be one as Pakistani Nation and grow up for Pakistan's Future". Wish you all the best.
Please visit www.vuaskari.com, get registered for old papers, quiz, assignments and GDBs...
You received this message because you are subscribed to the Google
Groups "VU ASKARI" group.
To post to this group, send email to askarivu@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/askarivu?hl=en?hl=en
Comments
Post a Comment