1. What is the following code segment doing?

void fn(){

char c;

cin.get(c);

if (c != ‘\n’) {

fn();

cout.put(c);

}}

A. The string entered is printed as it is.

B. The string entered is printed in reverse order.

C. It will go in an infinite loop.

D. It will print an empty line.

2. You have to sort a list L consisting of a sorted list followed by a few “random” elements. Which of the following sorting methods would be especially suitable for such a task?

A. Bubble sort

B. Selection sort

C. Quick sort

D. Insertion sort

3. Which techniqueused for direct search?

A. Binary Search

B. Linear Search

C. Tree Search

D. Hashing

4. The number of interchanges required to sort 5, 1, 6, 24 in ascending order using Bubble Sort Is

A. 6

B. 5

C. 7

D. 8

5. What data structure would you mostly likely see in a non-recursive implementation of a recursive algorithm?

A. Stack

B. Linked list

C. Queue

D. Trees

Other Related Questions

Technical Questions

1. Pick out the correct option. A. We cannot make an instance of an abstract base class B. We can make an instance of an abstract base class C. Both a & b D. None of the mentioned View Answer Answer: A. We cannot make an instance of an abstract base class Hide Answer 2. Where does the abstract class is used? A. base class only B. derived class C …

Technical Questions

1. Suppose a circular queue of capacity (n-1) elements is implemented with an array of n elements. Assume that the insertion and deletion operations are carried out using REAR and FRONT as array index variables, respectively. Initially REAR FRONT=0. The conditions to detect queue full and queue is empty are? A. Full: (REAR+1)mod n == FRONT Empty: REAR==FRONT B. Full: (REAR+1)mod n == FRONT Empty: (FRONT+1) mod n == REAR …

Technical Questions

1. Which is used to define the member of a class externally? Α. : B. :: C. # D. None of the mentioned View Answer Answer: B. :: Hide Answer 2. Which of the following is a valid class declaration? A. class A { int x; }; B. class B { } C. public class A{} D. object A { int x; }; View Answer Answer: A. class A {int …

Technical Questions

1. Heap is an example of A. complete binary tree B. spanning tree C. sparse tree D. binary search tree View Answer Answer: A. complete binary tree Hide Answer 2. Which of the following is not derived data type in c? A. Array B. Pointer C. Struct D. Enum View Answer Answer: D. Enum Hide Answer 3. Which of the following approach help us understand better about Real time examples, …

Technical Questions

1. The complexity of searching an element from a set of n elements using Binary search algorithm is A. O(n) B. O(log n) C. O(n2) D. O(n log n) View Answer Answer: B. O(log n) Hide Answer 2. What is not true about insertion sort? A. Exhibits the worst case performance when the initial array is sorted in reverse order. B. Worst case and average case performance is O(n2) C …

Technical Questions

1. A______is a linear list in which insertions and deletions are made from either end of the structure. A. circular queue B. random of queue C. priority D. dequeuer View Answer Answer: D. dequeuer Hide Answer 2. Linked lists are not suitable to for the implementation of? A. Insertion sort B. Radix sort C. Polynomial manipulation D. Binary search View Answer Answer: D. Binary search Hide Answer 3. A characteristic …

Technical Questions

1. Items in a priority queue are entered in a________order A. random B. order of priority C. as and when they come D. None of above View Answer Answer: B. order of priority Hide Answer 2. In a heap, element with the greatest key is always in the________node. A. leaf B. root C. first node of left sub tree D. first node of right sub tree View Answer Answer: B …

Technical Questions

1. The insertion operation in the stack is called_____ A. insert B. push C. pop D. top View Answer Answer: B. push Hide Answer 2. ________ is the term used to insert an element into stack. A. push B. pull C. pop D. pump View Answer Answer: A. push Hide Answer 3. What will be the output of the program given below in 16-bit platform? #include <stdio.h> int main() { …
Categories: