1 |
A kind of expression where the operator is present between two operands called ________ expressions . |
Postfix
Infix
Prefix
None of the above
|
2 |
"+” is a _________operator. |
Unary
Binary
Ternary
None of the above
|
3 |
it will be efficient to place stack elements at the start of the list because insertion and removal take
_______time. |
Variable
Constant
Inconsistent
None of the above
<br>
|
4 |
A binary tree with 24 internal node has ____ external node. |
22
23
48
25
|
5 |
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
|
6 |
Which of the given option is NOT a factor in Union by Size: |
Maintain sizes (number of nodes) of all trees, and during union.
Make smaller tree, the subtree of the larger one
Make the larger tree, the subtree of the smaller one.
Implementation: for each root node i, instead of setting parent[i] to -1, set it to -k if tree rooted at i has k
nodes
|
7 |
A complete binary tree of height ____ has nodes between 16-31. |
2
3
4
5
|
8 |
The maximum number of external nodes for a binary tree of height H is |
2<sup>h</sup>
2<sup>h</sup>+1
2<sup>h</sup>+2
2<sup>h</sup>+3
|
9 |
_________ is a data structure that can grow easily dynamically at run time without having to copy existing
elements. |
Array ()
List
Both of these
None of these
|
10 |
Consider a min heap, represented by the following array:
11,22,33,44,55
After inserting a node with value 66.Which of the following is the updated min heap? |
11,22,33,44,55,66
11,22,33,44,66,55
11,22,33,66,44,55
11,22,66,33,44,55
|
11 |
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
53
|
12 |
Consider a min heap, represented by the following array:
10,30,20,70,40,50,80,60
After inserting a node with value 31.Which of the following is the updated min heap? |
10,30,20,31,40,50,80,60,70
10,30,20,70,40,50,80,60,31
10,31,20,30,40,50,80,60,31
31,10,30,20,70,40,50,80,60
|
13 |
Which of the following statement is true about dummy node of threaded binary tree |
The left pointer of dummy node points to the itself while the right pointer points to the root of tree.
The left pointer of dummy node points to the root node of the tree while the right pointer points
itself i.e. to dummy node
The left pointer of dummy node points to the root node of the tree while the right pointer is always
NULL
The right pointer of dummy node points to the itself while the left pointer is always NULL
|
14 |
Huffman encoding uses _________ tree to develop codes of varying lengths for the letters used in the original
message |
Linked List
Stack
Queue
Binary tree
|
15 |
Merge sort and quicksort both fail 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.
|
16 |
A simple sorting algorithm like selection sort or bubble sort have a wrostcase of |
O(1) time because all lists take the same amount of time to sort
O(n) time because it has to perform n swaps to order the list.
O(n<sup>2</sup> ) time because sorting 1 element takes O(n) time - After 1 pass through the list, either of these
algorithms can guarantee that 1 element is sorted.
O(n<sup>3</sup> ) time, because the worst case has really random input which takes longer to sort.
|
17 |
Binary Search is an algorithm of searching ,used with the ____ data . |
Sorted
Unsorted
Heterogeneous
Heterogeneous
|
18 |
Union is a ___________ time operation |
Constant
Polynomial
Exponential
None of the above
|
19 |
Which of the following is not an example of equivalence relation: |
Electrical Connectivity
Set of people
<= relation
Set of pixels
|
20 |
The definition of Transitivity property is |
For all element x member of S, x R x
For all elements x and y, x R y if and only if y R x
For all elements x, y and z, if x R y and y R z then x R z
For all elements w, x, y and z, if x R y and w R z then x R z
|