A binary search tree is generated by inserting the following integers in the order: 50,15,62,5,20,58,91,3,8,37,60,24. How many nodes are in the left and right subtrees, respectively?
(4,7) 0.0%
(7,4) 100.0%
(8,3) 0.0%
(3,8) 0.0%
A binary tree, all the levels of which except possibly the last have the maximum number of nodes and all the nodes at the last level appear as far left as possible, is known as:
Full binary tree 0.0%
2-Tree 0.0%
Threaded tree 0.0%
Complete binary tree 100.0%
A chained hash table has an array size of 512. What is the maximum number of entries that can be placed in the table?
511 0.0%
512 0.0%
1024 0.0%
There is no maximum limit 100.0%
A circuit which is a connected graph and which includes every vertex of the graph is known as_____.
Euler 0.0%
Unicursal 0.0%
Hamiltonian 100.0%
Clique 0.0%
A given connected graph G is a Euler graph if and only if all vertices of G are of ______.
the same degree 0.0%
even degrees 100.0%
odd degrees 0.0%
different degrees 0.0%
A graph in which all nodes are of an equal degree is known as:
Multigraph 0.0%
Non - regular graph 0.0%
Regular graph 100.0%
Complete graph 0.0%
A matrix is called sparse when______
most of its elements are non-zero 0.0%
most of its elements are zero 100.0%
all of its elements are non-zero 0.0%
None of the above 0.0%
A non- planar graph with the minimum number of vertices has:
10 edges, 5 vertices 25.0%
9 edges, 6 vertices 75.0%
6 edges, 4 vertices 0.0%
9 edges, 5 vertices 0.0%
A one dimensional array A has indices 1...75. Each element is a string and takes up three memory words. The array is stored starting at location 1120 decimal. The starting address of A[49] is:
1267 0.0%
1164 0.0%
1264 100.0%
1169 0.0%
A procedure that calls itself in a program is called _______.
Repeat 0.0%
Loop 0.0%
Recursion 100.0%
Tree 0.0%
A simple graph in which there exists an edge between every pair of vertices is called a/an _________.
incomplete graph 0.0%
complete graph 100.0%
Euler graph 0.0%
planner graph 0.0%
A simple graph with n vertices and k components can have at the most _______.
n edges 0.0%
n-k edges 0.0%
(n-k)(n-k-1)/2 edges 0.0%
(n-k)(n-k+1)/2 edges 100.0%
A sparse matrix can be a lower-triangular matrix when____.
all the non-zero elements lie only on the leading diagonal 0.0%
all the non-zero elements lie above the leading diagonal 0.0%
all the non-zero elements lie below the leading diagonal 100.0%
None of the above 0.0%
Consider a hashing function that resolves collision by quadratic probing. Assume that the address space is indexed from 1 to 8. If a collision occurs at position 4, the location which will never be...
4 0.0%
5 0.0%
8 75.0%
2 25.0%
Consider a linked list implementation of a queue with two pointers: front and rear. The time needed to insert element in a queue of length n is:
O(1) 80.0%
O(log2n) 0.0%
O(n) 20.0%
O(n*log2n) 0.0%
Consider a linked list of n elements which is pointed by an external pointer. What is the time taken to delete the element which is a successor of the pointed element by a given pointer?
O(1) 100.0%
O(log2n) 0.0%
O(n) 0.0%
O(n*log2n) 0.0%
Consider the node of a complete binary tree whose value is stored in data[i] for an array implementation. If this node has a right child, where will the right child's value be stored (the array's f...
data[i+1] 0.0%
data[i+2] 0.0%
data[2*i + 1] 0.0%
data[2*i + 2] 100.0%
Consider this binary search tree. Which will be the new root if you remove the root and replace it with something from the left subtree?
1 0.0%
2 0.0%
4 0.0%
5 100.0%
For a complete binary tree with depth d, the total number of nodes is:
2d+1 83.0%
2d 0.0%
2d-1 16.0%
2d2 0.0%
Four characters are placed in a queue in the following order: D, C, B, and A. If they are removed one at a time, what will be the order of their removal?
ABCD 0.0%
ABDC 0.0%
DCAB 0.0%
DCBA 100.0%
Here is a code for an integer variable n while (n > 0) { n = n/10; // Use integer division } What is the worst case scenario analysis for the above loop?
O(1) 0.0%
O(log n) 100.0%
O(n) 0.0%
O(n2) 0.0%
How many real links are required for a sparse matrix having 10 rows, 10 columns and 15 non-zero elements? (Pick the nearest answer)
15 100.0%
20 0.0%
50 0.0%
100 0.0%
If 'data' is a circular array of CAPACITY elements and 'last' is an index in that array, what is the formula for the index after 'last'?
(last % 1) + CAPACITY 0.0%
last % (1 + CAPACITY) 0.0%
(last + 1) % CAPACITY 100.0%
last + (1 % CAPACITY) 0.0%
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[0] 33.0%
data[n-1] 66.0%
data[n] 0.0%
data[2*n + 1] 0.0%
If h is the depth of the tree, which formula will be used to find the maximum number of nodes n in a perfect binary tree?
2h + 1 - 1 0.0%
2h + 1 100.0%
2h 0.0%
2h + 1 + 1 0.0%
If X is the adjacency matrix of a graph G with no self loops, the entries along the principle diagonal of X are ______.
all zeros 100.0%
all ones 0.0%
both zeros and ones 0.0%
different 0.0%
In a complete binary tree of n nodes, how far are the most distant two nodes? Assume each in the path counts 1. Assume log(n) is log base 2.
about log(n) 0.0%
about 2*log(n) 100.0%
about 3*log(n) 0.0%
about 4*log(n) 0.0%
In a complete binary tree, the parent of any node k can be determined by ________.
2k 0.0%
2k+1 0.0%
K/2 100.0%
2K-1 0.0%
In a graph G having the cut set matrix C(G) and an incidence matrix A(G), the rank of C(G) would be____
The same as that of A(G) 0.0%
More than that of A(G) 0.0%
Less than that of A(G) 100.0%
Independent of the rank of A(G) 0.0%
In a graph G, F is a spanning forest of G if (i)F is a subgraph of G containing all the nodes of G (ii)F is an order forest containing trees T1,T2,...Tn (iii)Ti contains all the nodes that are rea...
(i),(ii) 100.0%
(ii),(iii) 0.0%
(i),(iii) 0.0%
(i),(ii) and (iii) 0.0%
In a selection sort algorithm, the number of passes required to perform the sort are ______.
N 0.0%
N-1 100.0%
N-2 0.0%
N^2 0.0%
In the linked representation of a sparse matrix, the head node for a column list stores_____
a pointer to the next column head node 0.0%
a pointer to the first node in the column list 0.0%
column number 100.0%
All of the above 0.0%
In which data structure do the insertion and deletion take place at the same end?
Linked list 0.0%
Tree 0.0%
Stack 100.0%
Linked list of stack 0.0%
In which data structure is the concept of rotation used?
Binary search tree 0.0%
Circular queue 0.0%
AVL tree 100.0%
Circular linked list 0.0%
In which dynamically created linked list can the first node be recovered after moving to the second node?
Simple linked list 0.0%
Circular linked list 0.0%
Doubly linked list 0.0%
Both b and c 100.0%
Let A be a sorted array of n=10 elements. Assume that only one comparison is required to determine whether the target is equal to, less than, or greater than A[i]. Which of the following denotes th...
1.6 0.0%
2.9 100.0%
4.2 0.0%
5.5 0.0%
One difference between a queue and a stack is:
Queues require dynamic memory but stacks do not 0.0%
Stacks require dynamic memory but queues do not 0.0%
Queues use two ends of the structure but stacks use only one 100.0%
Stacks use two ends of the structure but queues use only one 0.0%
State whether True or False. For all possible inputs, a linear algorithm to solve a problem must perform faster than a quadratic algorithm to solve the same problem.
Suppose T is a complete binary tree with 14 nodes. What would be the minimum possible depth of T?
0 0.0%
3 25.0%
4 75.0%
5 0.0%
Suppose we have a circular array implementation of a queue, with ten items in the queue stored at data[2] through data[11]. The CAPACITY is 42. Where does the enqueue member function place the new ...
data[1] 0.0%
data[2] 0.0%
data[11] 0.0%
data[12] 100.0%
Suppose we have a circular array implementation of a queue, with ten items in the queue stored at data[2] through data[11]. The CAPACITY is 42. Where does the push member function place the new ent...
data[1] 0.0%
data[2] 0.0%
data[11] 0.0%
data[12] 100.0%
Suppose X is a B-tree leaf containing 41 entries and has at least one sibling. Which of the statements would be true in this case?
Any sibling of X is also a leaf 100.0%
Any sibling of X contains at least 41 entries 0.0%
The parent of X has exactly 42 entries 0.0%
X has at least 41 siblings 0.0%
The hashing function which dynamically adapts to changes in the table being accessed is called ________.
Real 0.0%
Linear 0.0%
Partial 0.0%
Virtual 100.0%
The linked list implementation of sparse matrices is superior to the generalized dope vector method because it is __________.
conceptually easier and completely dynamic 0.0%
efficient if the sparse matrix is a band matrix 100.0%
efficient in accessing an entry 0.0%
all of these 0.0%
The minimum number of interchanges needed to convert the array 89,19,14,40,17,12,10,2,5,7,11,6,9,70 into a heap with the maximum element at the root is:
0 0.0%
1 0.0%
2 0.0%
3 100.0%
The number of distinct simple graphs with up to three nodes is _______.
15 0.0%
10 0.0%
7 100.0%
9 0.0%
The number of nodes in the largest maximal independent set of the complete bipartite graph K(4,2) is_____ .
2 0.0%
3 0.0%
4 100.0%
6 0.0%
The operation for adding an entry to a stack is traditionally called ________.
add 0.0%
append 0.0%
insert 0.0%
push 100.0%
The operation for removing an entry from a stack is traditionally called _______.
delete 0.0%
peek 0.0%
pop 100.0%
remove 0.0%
The post-order traversal of a binary tree starts with:
Post-order traversal of the left sub tree 100.0%
Post-order traversal of the right sub tree 0.0%
Post-order traversal of the root 0.0%
Post-order traversal of the lowest node 0.0%
The recurrence relation T(n)=mT(n/2)+an2 is satisfied by___
T(n)=O(nm) 0.0%
T(n)=O(m*log(m)) 0.0%
T(n)=O(n*log(m)) 0.0%
T(n)=O(m*log(n)) 100.0%
Tree algorithms typically run in time O(d) . What is d?
The depth of the tree 100.0%
The number of divisions at each level 0.0%
The number of nodes in the tree 0.0%
The total number of entries in all the nodes of the tree 0.0%
Using which traversal in a sorted binary insertion tree can a sorted array of numbers be obtained?
Pre-order traversal 0.0%
Post-order traversal 0.0%
In order traversal 100.0%
Top-down traversal 0.0%
What do we call a binary tree in which all the levels, except possibly the last level, have the maximum number of nodes, and in which all the nodes at the last level appear as far left as possible?
Full binary tree 0%
2-Tree 0%
Threaded tree 0%
Complete binary tree 0%
What happens if you make a recursive call without making the problem smaller?
The operating system detects the infinite recursion because of the "repeated state" 0.0%
The program keeps running until you press Ctrl-C 0.0%
The results are non-deterministic 0.0%
The run-time stack overflows, halting the program 100.0%
What is the best definition of a collision in a hash table?
Two entries are identical except for their keys 0.0%
Two entries with different data have exactly the same key 0.0%
Two entries with different keys have exactly the same hash value 100.0%
Two entries with exactly the same key have different hash values 0.0%
What is the formulae to find maximum number of nodes n in a perfect binary tree?
2h + 1 - 1 100.0%
2h + 1 0.0%
2h 0.0%
2h + 1 + 1 0.0%
What is the maximum depth of recursive calls a function may make?
1 0.0%
2 0.0%
n (where n is the argument) 0.0%
There is no fixed maximum 100.0%
What is the maximum number of statements that may be recursive calls in a single function declaration?
1 0.0%
2 0.0%
n (n is the argument) 0.0%
There is no fixed maximum 100.0%
What is the meaning of the statement: "Entries in a stack are 'ordered'"?
A collection of stacks can be sorted 0.0%
Stack entries may be compared with the '<' operation 100.0%
The entries must be stored in a linked list 0.0%
There is a first entry, a second entry, and so on 0.0%
What is the minimum number of edges and vertices possible in a non- planar graph?
10 edges, 5 vertices 100.0%
9 edges, 6 vertices 0.0%
6 edges, 4 vertices 0.0%
9 edges, 5 vertices 0.0%
What is the minimum number of edges which must be removed from a complete bipartite graph of six nodes K(6) so that the remaining graph is a planar?
2 0.0%
3 0.0%
4 0.0%
6 100.0%
What is the minimum number of nodes in a complete binary tree with depth 3?
4 0.0%
8 0.0%
11 100.0%
15 0.0%
What is the minimum number of nodes in a full binary tree with depth 3?
4 0.0%
8 0.0%
11 0.0%
15 100.0%
What is the pre-order traversal equivalent of the following algebraic expression? [a+(b-c)]*[(d-e)/(f+(g-h))]
abc-+de-fg+h-/* 0.0%
*+a-bc/-de+f-gh 100.0%
a+*b-/c-d-e+fgh 0.0%
*+a-bc-/d+e-fgh 0.0%
What is the pre-order traversal equivalent of the following algebraic expression? [a+(b-c)]*[(d-e)/(f+g-h)]
abc-+de-fg+h-/* 0.0%
*+a-bc/-de-+fgh 100.0%
a+*b-/c-d-e+fgh 0.0%
*+a-bc-/d+e-fgh 0.0%
What is the value of the post-fix expression 6 3 2 4 + - *?
Something between -15 and -100 100.0%
Something between -5 and -15 0.0%
Something between 5 and 15 0.0%
Something between 15 and 100 0.0%
What is the worst-case scenario for heapsort to sort an array of n elements?
O(log n) 0.0%
O(n) 0.0%
O(n log n) 100.0%
O(n2) 0.0%
What is the worst-case scenario for mergesort to sort an array of n elements?
O(log n) 0.0%
O(n) 0.0%
O(n log n) 100.0%
O(n2) 0.0%
What is the worst-case scenario for quicksort to sort an array of n elements?
O(log n) 0.0%
O(n) 0.0%
O(n log n) 0.0%
O(n2) 100.0%
What is the worst-case scenario for the binary search for finding a single item in an array?
Constant time 0.0%
Logarithmic time 0.0%
Linear time 100.0%
Quadratic time 0.0%
What is the worst-case scenario for the binary search for finding a single item in an sorted array?
Constant time 0.0%
Logarithmic time 0.0%
Linear time 100.0%
Quadratic time 0.0%
What is true of the complete bipartite graphs K(3,3) and K(2,4)?
Both are planar 0.0%
Neither is a planar 33.0%
Both are isomorphic 0.0%
None of these 66.0%
What kind of initialization needs to be done for a chained hash table?
None 0.0%
The key at each array location must be initialized 0.0%
The head pointer of each chain must be set to NULL 100.0%
Both B and C must be carried out 0.0%
What will happen if in data structure a pop operation on the stack causes the stack pointer to move past the origin of the stack?
Overflow 0.0%
Underflow 100.0%
Null 0.0%
Garbage collection 0.0%
Where does the push member function place the new entry on the linked list in the linked list implementation of a queue?
At the head 0.0%
At the tail 100.0%
After all other entries that are greater than the new entry 0.0%
After all other entries that are smaller than the new entry 0.0%
Which additional requirement is placed on an array so that binary search may be used to locate an entry?
The array elements must form a heap 0.0%
The array must have at least 2 entries 0.0%
The array must be sorted 100.0%
The array's size must be a power of two 0.0%
Which feature of heaps allows them to be efficiently implemented using a partially filled array?
Heaps are binary search trees 0.0%
Heaps are complete binary trees 100.0%
Heaps are full binary trees 0.0%
Heaps contain only integer data 0.0%
Which formula is the best approximation for the depth of a heap with n nodes?
log (base 2) of n 0%
The number of digits in n (base 10) 0%
The square root of n 0%
n 0%
Which graph traversal algorithm uses a queue to keep track of the vertices which need to be processed?
Breadth-first search 100.0%
Depth-first search 0.0%
Which information is not saved in the activation record when a function call is executed?
Current depth of recursion 100.0%
Formal parameters 0.0%
Location where the function should return when done 0.0%
Local variables 0.0%
Which of the following applications may use a stack?
A parentheses balancing program 0.0%
Keeping track of local variables at run time 0.0%
Syntax analyzer for a compiler 0.0%
All of the above 100.0%
Which of the following data structures has a balanced condition?
AVL Tree 100.0%
Doubly Linked List 0.0%
Double Ended Queue 0.0%
Stack 0.0%
Which of the following formulae in big-Oh notation best represents the expression n2+35n+6?
O(n3) 0.0%
O(n2) 100.0%
O(n) 0.0%
O(42) 0.0%
Which of the following is false?
A binary search begins with the middle element in the array 0.0%
A binary search continues halving the array either until a match is found or until there are no more elements to search 0.0%
If the search argument is greater than the value located in the middle of the binary, the binary search continues in the lower half of the array 100.0%
Which of the following is the worst-case scenario for operations on heaps?
Neither insertion nor removal is better than linear 0.0%
Insertion is better than linear, but removal is not 100.0%
Removal is better than linear, but insertion is not 0.0%
Both insertion and removal are better than linear 0.0%
Which of the following lines of the code will delete two successive nodes of a single linked linear list(with more than two nodes)? Here 'LINK[X]' denotes the address field of node X.
LINK[X]:=LINK[LINK[X]] 0.0%
X:=LINK[LINK[X]] 0.0%
LINK[LINK[X]]:=X 0.0%
LINK[X]:=LINK[LINK[LINK[X]]] 100.0%
Which of the following operations in the simple linked list will modify the beginning of the linked list?
Deletion of the first node 0.0%
Insertion after the last node 0.0%
Insertion after the first node 0.0%
None of the above 100.0%
Which of the following operations is more expensive in the dynamically created linked list than it is in the conventional array?
Finding Kth element 0%
Insertion 0%
Deletion 0%
Traversing 0%
Which of the following operations is performed more efficiently by the doubly linked list than by the linear linked list?
Deleting a node the location of which is given 100.0%
Searching an unsorted list for a given item 0.0%
Inserting a node after the node with a given location 0.0%
Traversing the list to process each node 0.0%
Which of the following sorting algorithms yield approximately the same worst-case and average-case running time behavior in O(n*log(n))?
Bubble sort and selection sort 0.0%
Heap sort and merge sort 100.0%
Quick sort and radix sort 0.0%
Tree sort and Median-of-3 quicksort 0.0%
Which of the following statements about binary trees is false?
Every Node must have at least two children 100.0%
Every non-empty tree has exactly one root node 0.0%
Every node has at the most two children 0.0%
None of the above 0.0%
Which of the following techniques is used to resolve collision in hashing?
Separate chaining 0.0%
Open addressing 0.0%
Linear probing 0.0%
All of the above 100.0%
Which of the operations is simpler in the doubly linked list than it is in the simple linked list?
Insertion 0.0%
Deletion 100.0%
Both a and b 0.0%
None of the above 0.0%
Which of these are standard operations of Stack Data Structure?
Push, delete 0.0%
Insert, pop 0.0%
Put, extract 0.0%
Push, pop 100.0%
Which operations require linear time for their worst-case behavior in the linked-list version of a queue?
front 0.0%
push 0.0%
empty 100.0%
None of these operations require linear time 0.0%
Which queue allows insertion and deletion at both ends?
Simple queue 0.0%
Circular queue 100.0%
Dequeue 0.0%
Special queue 0.0%
Which situation occurs frequently if the selected hash function is poor?
Overflow 0.0%
Underflow 0.0%
Collision 100.0%
None of the above 0.0%
Which term is used to describe an O(n) algorithm?
Constant 0.0%
Linear 100.0%
Logarithmic 0.0%
Quadratic 0.0%
You have implemented a queue with a circular array keeping track of the first item, the last item, and the count (the number of items in the array). Suppose the address of the first is zero, and th...
The count must be zero 0.0%
The count must be CAPACITY 100.0%
The count can be zero or CAPACITY, but no other value can occur 0.0%
None of the above 0.0%
You have implemented a queue with a circular array keeping track of the first, the last, and the count (the number of items in the array). Suppose the first is zero, and the last is CAPACITY-1, wha...
The count must be zero 0.0%
The count must be CAPACITY 100.0%
The count can be zero or CAPACITY, but no other value can occur 0.0%
None of the above 0.0%
You have implemented a queue with a linked list keeping track of a front pointer and a rear pointer. Which of these pointers will you change during an insertion in the middle of a NONEMPTY queue?
Neither of them changes 0%
Only front_ptr changes 0%
Only rear_ptr changes 0%
Both change 0%
You have implemented a queue with a linked list keeping track of a front pointer and a rear pointer. Which of these pointers will you change during an insertion into a NONEMPTY queue?
Neither of them changes 0.0%
Only front_ptr changes 0.0%
Only rear_ptr changes 100.0%
Both change 0.0%