July 17, 2021 in C and CPP
The number of comparisons needed to merge-sort a list of n elements is
1.10 The number of comparisons needed to merge-sort a list of n elements is
A) O(n log n)
B) O(n log log n)
C) O(n)
D) O(n log n2 )
July 17, 2021 in C and CPP
1.10 The number of comparisons needed to merge-sort a list of n elements is
A) O(n log n)
B) O(n log log n)
C) O(n)
D) O(n log n2 )
July 17, 2021 in C and CPP
1.9 The number vertices in a full m-ary tree with i internal nodes is
A) mi + 1
B) 2^mi – 1
C) Mi
D) 2^mi-1
July 17, 2021 in C and CPP
1.8 Which of the following statement is false?
A) In a circular queue, overflow occurs less frequently than in a simple queue
B) In a deque, insertion and deletion of elements can take place on either end
C) In a priority queue, insertion of new elements always takes place at one end
D) None of the above
July 17, 2021 in C and CPP
1.7 The number of null pointers in a binary tree with k internal nodes is
A) k + 1
B) k – 1
C) k
D) The number depends on the slope of the tree
July 17, 2021 in C and CPP
1.6 Which of the following statements is true?
A) A binary tree is always a heap
B) A heap is a full binary tree
C) A heap is a complete binary tree
D) Root of the heap is always the smallest element in the heap
July 17, 2021 in C and CPP
1.5 In the text of the divide and conquer algorithm must contain at least
A) One recursive call
B) Two recursive calls
C) Either one or zero calls
D) None of the above
July 17, 2021 in C and CPP
1.4 To insert a node at the end of the singly connected linked list having ‘p’ nodes, how
many nodes are to be traversed for this insertion operation?
A) p/2
B) p
C) 1
D) none of the above
July 17, 2021 in C and CPP
1.3 int *p;
Refer to the above declaration which one of the following statements are true regarding
the expression ((char *)p)++?
A) It gives the first byte of the value pointed by p and increments p by 1.
B) It increases p by 1
C) This expression is not portable
D) It increments the first byte of the value pointed by p by 1.
July 17, 2021 in C and CPP
1.2 Depth first traversal of a graph produces
A) a spanning tree of the graph
B) a spanning forest of the graph
C) a minimal spanning tree
D) none of the above
July 17, 2021 in C and CPP
1.1 Referring to the sample code given below what will be new contents of array x.
int x[10] = {1,2,3,4,5,6,7,8,9,10};
int y = 20; int i = 10;
x[ - - i ] = y;
A) {1,2,3,4,5,6,7,8,9,10}
B) {20,2,3,4,5,6,7,8,9,10}
C) {1,2,3,4,5,6,7,8,9,20}
D) {1,2,3,4,5,6,7,8,20,10}