Data Structures and Algorithms Quiz # 3

Instructions
Quiz: Data Structures and Algorithms Quiz # 3
Total Questions: 30 MCQs
Time: 30 Minutes

Note

  • Do not refresh the page while taking the test.
  • Results along with correct answers will be shown at the end of the test.
Data Structures And Algorithms Quiz # 3
Question 1 of 30
00:00
  • 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?

  • 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 entry in the array?

  • Which of the following sorting algorithms yield approximately the same worst-case and average-case running time behavior in O(n*log(n))?

  • The operation for adding an entry to a stack is traditionally called ________.

  • For a complete binary tree with depth d, the total number of nodes is:

  • Which of the following is false?

  • Which of the following applications may use a stack?

  • What is the value of the post-fix expression 6 3 2 4 + - *?

  • 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:

  • Suppose T is a complete binary tree with 14 nodes. What would be the minimum possible depth of T?

  • In which data structure do the insertion and deletion take place at the same end?

  • What is the formulae to find maximum number of nodes n in a perfect binary tree?

  • A chained hash table has an array size of 512. What is the maximum number of entries that can be placed in the table?

  • In which dynamically created linked list can the first node be recovered after moving to the second node?

  • What is the best definition of a collision in a hash table?

  • What is the pre-order traversal equivalent of the following algebraic expression? [a+(b-c)]*[(d-e)/(f+g-h)]

  • A sparse matrix can be a lower-triangular matrix when____.

  • A graph in which all nodes are of an equal degree is known as:

  • What is the maximum number of statements that may be recursive calls in a single function declaration?

  • Which additional requirement is placed on an array so that binary search may be used to locate an entry?

  • What is the worst-case scenario for heapsort to sort an array of n elements?

  • The recurrence relation T(n)=mT(n/2)+an2 is satisfied by___

  • 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 first index is 0)?

  • In a complete binary tree, the parent of any node k can be determined by ________.

  • 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?

  • 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?

  • 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 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 reachable in G from the root Ti and are contained in Tj for some j

     

    Which of the above conditions is/are true?

  • Which information is not saved in the activation record when a function call is executed?

  • The linked list implementation of sparse matrices is superior to the generalized dope vector method because it is __________.