Which of the following statements hold true for binary trees?
The left subtree of a node contains only nodes with keys less than the node’s key The right subtree of a node contains only nodes with keys greater than the node’s key Both a and b above None of the above
In a heap, element with the greatest key is always in the _______ node.
leaf first node of left sub tree first node of right sub tree root
Number of selections required to sort a file of size N by straight selection requires ______.
N - 1 O(N2) log N None of the above
An empty list is the one which has no __________.
data nodes address both a and b
The space factor when determining the efficiency of algorithm is measured by ____________.
Counting the minimum memory needed by the algorithm Counting the average memory needed by the algorithm Counting the maximum disk space needed by the algorithm Counting the maximum memory needed by the algorithm
Which among the following is the best when the list is already sorted?
Bubble sort Insertion sort Merge sort Selection sort
The recurrence relation capturing the optimal execution time of the Towers of Hanoi problem with n discs is ______.
T(n) = 2T(n - 1) + 1 T(n) = 2T(n - 1) + n T(n) = 2T(n - 2) + 2 T(n) = 2T(n/2) + 1
The complexity of Bubble sort algorithm is _________.
O(n) O(n log n) O(n2) O(log n)
Heap is defined to be a ___________.
binary tree tree structure complete binary tree None of the above
Inserting an item into the stack when stack is not full is called ___________.Operation and deletion of item form the stack, when stack is not empty is called ___________operation.
delete, insert pop, push insert, delete push, pop
0 Comments