Question 1
Question
Two main measures for the efficiency of an algorithm are
Answer
-
Processor and memory
-
Complexity and capacity
-
Time and space
-
Data and space
Question 2
Question
The complexity of Binary search algorithm is
Answer
-
O(n)
-
O(log n)
-
O(n^2)
-
O(n log n)
Question 3
Question
Which of the following data structure is not linear data structure?
Answer
-
Arrays
-
Linked lists
-
Both
-
None
Question 4
Question
The complexity of merge sort algorithm is
Answer
-
O(n)
-
O(log n)
-
O(n^2)
-
O(n log n)
Question 5
Question
When determining the efficiency of algorithm the time factor is measured by
Answer
-
Counting microseconds
-
Counting the number of key operations
-
Counting the number of statements
-
Counting the kilobytes of algorithm
Question 6
Question
When determining the efficiency of algorithm, the space factor is measured by
Answer
-
Counting the maximum memory needed by the algorithm
-
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
Question 7
Question
Which of the following is not the internal sort?
Answer
-
Insertion Sort
-
Bubble Sort
-
Merge Sort
-
Heap Sort
Question 8
Question
Given two sorted lists of size m and n respectively.The number of comparisons needed in the worst case by the merge sort algorithm will be?
Answer
-
mn
-
max(m,n)
-
min(m,n)
-
m+n-1
Question 9
Question
To represent hierarchical relationship between elements, Which data structure is suitable?
Question 10
Question
The postfix expression for * + a b - c d is?
Answer
-
ab + cd - *
-
ab cd + - *
-
ab + cd * -
-
ab + - cd *
Question 11
Question
A circular queue is implemented using an array of size 10. The array index starts with 0, front is 6, and rear is 9. The insertion of next element takes place at the array index.
Question 12
Question
Which type of traversal of binary search tree outputs the value in sorted order?
Answer
-
Pre-order
-
In-order
-
Post-order
-
None
Question 13
Question
If the given input array is sorted or nearly sorted, which of the following algorithm gives the best performance?
Answer
-
Insertion sort
-
Selection sort
-
Quick sort
-
Merge sort
Question 14
Question
The type of expression in which operator succeeds its operands is?
Answer
-
Infix Expression
-
prefix Expression
-
postfix Expression
-
None
Question 15
Question
The postfix form of the expression (A+ B)*(C*D- E)*F / G is?
Answer
-
AB+ CD*E - FG /**
-
AB + CD* E - F **G /
-
AB + CD* E - *F *G /
-
AB + CDE * - * F *G /
Question 16
Question
In linked list, pointer is pointing to the first element of the node then time require to insert element to second position is
Question 17
Question
Time require to find any element of the linked list is
Answer
-
O(n)
-
O(1)
-
None of these
-
O(n^2)
Question 18
Question
If start is pointing to first node of the linked list then consider the following statement -
start = start->next;
current = start->next;
what will be the value of address field of current ?
Question 19
Question
Consider the following linked list and following linked list representation -
struct node {
int data;
struct node *next;
}*start = NULL;
what will be the value of following statement ?
start->next->next->next->data
Question 20
Question
In Circular Linked List insertion of a node involves the modification of ____ links.
Question 21
Question
If in a linked list address of first node is 1020 then what will be the address of node at 5th position ?
Answer
-
1036
-
1028
-
1025
-
None of these
Question 22
Question
Which of the following operation is performed more efficiently in doubly linked list ?
Answer
-
Inserting a node at given position
-
None of these
-
Deleting a node at given position
-
Searching a node at given position
Question 23
Question
When new element is added in the middle of singly linked list then ________.
Answer
-
Only elements that appear after the new element need to be moved
-
Only elements that appear before the new element need to be moved
-
No need to move element
-
Only elements that appear after the new element and before need to be moved
Question 24
Question
Consider linked list is used to implement the Stack then which of the following node is considered as Top of the Stack ?
Answer
-
Any Node
-
Last Node
-
First Node
-
Middle Node
Question 25
Question
Consider the following linked list representation -
struct node {
int data;
struct node *next;
}start = NULL;
struct node *new_node;
Which of the following statement is used to create a node ?
Answer
-
new_node=(struct node *)malloc((struct node));
-
new_node=(struct *)malloc(sizeof(struct node));
-
new_node=(struct node)malloc(sizeof(struct node));
-
new_node=(struct node *)malloc(sizeof(struct node));
Question 26
Question
Which of the following data structure is linear type?
Answer
-
Strings
-
Lists
-
Queues
-
All of above
Question 27
Answer
-
Values in a node is greater than every value in left sub tree and smaller than right sub tree
-
Values in a node is greater than every value in children of it
-
Both of above conditions applies
-
None of above conditions applies
Question 28
Question
The order of an algorithm that finds whether a given Boolean function of 'n' variables, produces a 1 is
Answer
-
linear
-
constant
-
exponential
-
logarithmic
Question 29
Question
A list integers is read in, one at a time, and a binary search tree is constructed. Next the tree is traversed would result in a printout which duplicates the original order of the list of integers?
Answer
-
Inorder
-
Preorder
-
Postorder
-
None of these
Question 30
Question
A characteristic of the data that binary search uses but the linear search ignores, is
Question 31
Question
Queue can be used to implement
Answer
-
recursion
-
radix sort
-
quick sort
-
depth first search
Question 32
Question
Which of the following sorting methods sorts a given set of items that is already in sorted order or in reverse sorted order with equal speed?
Answer
-
Heap sort
-
Quick sort
-
Selection sort
-
Insertion sort
Question 33
Question
Suppose DATA array contains 1000000 elements. Using the binary search algorithm, one requires only about n comparisons to find the location of an item in the DATA array, then n is
Question 34
Question
A sort which iteratively passes through a list to exchange the first element with any element less than it and then repeats with a new first element is called
Answer
-
heap sort
-
quick sort
-
selection sort
-
insertion sort
Question 35
Question
The maximum number of comparisons needed to sort 7 items using radix sort is (assume each item is 4 digit decimal number)
Question 36
Question
The postfix equivalent of the prefix * + a b - c d is
Answer
-
ab+cd-*
-
ab + cd * -
-
ab + - cd *
-
ab cd + - *
Question 37
Question
A complete binary tree with the property that the value at each node is at least as large as the values at its children is called
Answer
-
Heap
-
Binary Tree
-
Binary search tree
-
Completely balanced tree
Question 38
Question
A full binary tree with n leaves contains
Answer
-
n nodes
-
log2n nodes
-
2n+1 nodes
-
2n - 1 nodes
Question 39
Question
Traversing a binary tree first root and then left and right subtrees called _______traversal.
Answer
-
inorder
-
preorder
-
postorder
-
none of these
Question 40
Question
The number of nodes in a complete binary tree of level 5 is
Question 41
Question
Number of possible binary trees with 3 nodes is
Question 42
Question
A binary tree is generated by inserting in order the following integers: 50, 15, 62, 5, 20,58, 91, 3,8,37, 60, 24 The number of nodes in the left of the root respectively is
Question 43
Question
The depth of a complete binary tree with n nodes is (log is to be base two)
Answer
-
log(n)
-
log(n) + 1
-
log (n-1) + 1
-
log (n+1)-1
Question 44
Question
Which of the following are valid characters for a numeric literal constant?
Answer
-
a comma ( , )
-
a dollar sign ($)
-
a percent sign (%)
-
None of the above
Question 45
Question
A default catch block catches
Question 46
Question
When the compiler cannot differentiate between two overloaded constructors, they are called
Answer
-
overloaded
-
destructed
-
ambiguous
-
dubious
Question 47
Question
When you pass a variable _____, C++ passes only the contents of the variable to the receiving function
Answer
-
by reference
-
by value
-
globally
-
locally
Question 48
Question
Paying attention to the important properties while ignoring inessential details is known as________
Answer
-
selectiveness
-
polymorphism
-
abstraction
-
summarizing
Question 49
Question
When you omit parameters from a function call, values can be provided by
Answer
-
formal parameters
-
reference parameters
-
overloaded parameters
-
default parameters
Question 50
Question
The items listed in the function header are called _____
Answer
-
actual arguments
-
formal parameters
-
passed parameters
-
sent arguments