Data Structures Test
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?
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:
A chained hash table has an array size of 512. What is the maximum number of entries that can be placed in the table?
A circuit which is a connected graph and which includes every vertex of the graph is known as_____.
A given connected graph G is a Euler graph if and only if all vertices of G are of ______.
A graph in which all nodes are of an equal degree is known as:
A matrix is called sparse when______
A non- planar graph with the minimum number of vertices has:
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:
A procedure that calls itself in a program is called _______.
A simple graph in which there exists an edge between every pair of vertices is called a/an _________.
A simple graph with n vertices and k components can have at the most _______.
A sparse matrix can be a lower-triangular matrix when____.
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...
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:
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?
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...
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?
For a complete binary tree with depth d, the total number of nodes is:
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?
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?
How many real links are required for a sparse matrix having 10 rows, 10 columns and 15 non-zero elements? (Pick the nearest answer)
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'?
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?
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?
If X is the adjacency matrix of a graph G with no self loops, the entries along the principle diagonal of X are ______.
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.
In a complete binary tree, the parent of any node k can be determined by ________.
In a graph G having the cut set matrix C(G) and an incidence matrix A(G), the rank of C(G) would be____
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...
In a selection sort algorithm, the number of passes required to perform the sort are ______.
In the linked representation of a sparse matrix, the head node for a column list stores_____
In which data structure do the insertion and deletion take place at the same end?
In which data structure is the concept of rotation used?
In which dynamically created linked list can the first node be recovered after moving to the second node?
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...
One difference between a queue and a stack is:
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?
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 ...
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...
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?
The hashing function which dynamically adapts to changes in the table being accessed is called ________.
The linked list implementation of sparse matrices is superior to the generalized dope vector method because it is __________.
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:
The number of distinct simple graphs with up to three nodes is _______.
The number of nodes in the largest maximal independent set of the complete bipartite graph K(4,2) is_____ .
The operation for adding an entry to a stack is traditionally called ________.
The operation for removing an entry from a stack is traditionally called _______.
The post-order traversal of a binary tree starts with:
The recurrence relation T(n)=mT(n/2)+an2 is satisfied by___
Tree algorithms typically run in time O(d) . What is d?
Using which traversal in a sorted binary insertion tree can a sorted array of numbers be obtained?
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?
What happens if you make a recursive call without making the problem smaller?
What is the best definition of a collision in a hash table?
What is the formulae to find maximum number of nodes n in a perfect binary tree?
What is the maximum depth of recursive calls a function may make?
What is the maximum number of statements that may be recursive calls in a single function declaration?
What is the meaning of the statement: "Entries in a stack are 'ordered'"?
What is the minimum number of edges and vertices possible in a non- planar graph?
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?
What is the minimum number of nodes in a complete binary tree with depth 3?
What is the minimum number of nodes in a full binary tree with depth 3?
What is the pre-order traversal equivalent of the following algebraic expression? [a+(b-c)]*[(d-e)/(f+(g-h))]
What is the pre-order traversal equivalent of the following algebraic expression? [a+(b-c)]*[(d-e)/(f+g-h)]
What is the value of the post-fix expression 6 3 2 4 + - *?
What is the worst-case scenario for heapsort to sort an array of n elements?
What is the worst-case scenario for mergesort to sort an array of n elements?
What is the worst-case scenario for quicksort to sort an array of n elements?
What is the worst-case scenario for the binary search for finding a single item in an array?
What is the worst-case scenario for the binary search for finding a single item in an sorted array?
What is true of the complete bipartite graphs K(3,3) and K(2,4)?
What kind of initialization needs to be done for a chained hash table?
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?
Where does the push member function place the new entry on the linked list in the linked list implementation of a queue?
Which additional requirement is placed on an array so that binary search may be used to locate an entry?
Which feature of heaps allows them to be efficiently implemented using a partially filled array?
Which formula is the best approximation for the depth of a heap with n nodes?
Which graph traversal algorithm uses a queue to keep track of the vertices which need to be processed?
Which information is not saved in the activation record when a function call is executed?
Which of the following applications may use a stack?
Which of the following data structures has a balanced condition?
Which of the following formulae in big-Oh notation best represents the expression n2+35n+6?
Which of the following is false?
Which of the following is the worst-case scenario for operations on heaps?
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.
Which of the following operations in the simple linked list will modify the beginning of the linked list?
Which of the following operations is more expensive in the dynamically created linked list than it is in the conventional array?
Which of the following operations is performed more efficiently by the doubly linked list than by the linear linked list?
Which of the following sorting algorithms yield approximately the same worst-case and average-case running time behavior in O(n*log(n))?
Which of the following statements about binary trees is false?
Which of the following techniques is used to resolve collision in hashing?
Which of the operations is simpler in the doubly linked list than it is in the simple linked list?
Which of these are standard operations of Stack Data Structure?
Which operations require linear time for their worst-case behavior in the linked-list version of a queue?
Which queue allows insertion and deletion at both ends?
Which situation occurs frequently if the selected hash function is poor?
Which term is used to describe an O(n) algorithm?
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...
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...
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?
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?