Question 1
Question
Naming convention for variable is followed in company because ____.
Answer
-
A. it enhances readability
-
B. it allows to work without conflicts
-
C. it enhances the efficiency
-
D. all of the above
Question 2
Question
The true and false values represent ____.
Answer
-
A. logical data
-
B. numeric data
-
C. character data
-
D. alphanumeric data
Question 3
Question
Following operator distinguishes equation from expression
Answer
-
A. +, -, *, /
-
B. < or >
-
C. Logical operators
-
D. Assignment Operator
Question 4
Question
Following are called logical operators
Answer
-
A. +, -, *, /
-
B. <, >, <=, >=
-
C. AND, OR, NOT
-
D. \, MOD
Question 5
Question
Evaluate 5*(x+y)-4*y/(z+6) where x = 2, y = 3, and z = 6
Question 6
Question
Evaluate a-2>b where a=6, b = 8
Answer
-
A. False
-
B. True
-
C. 6
-
D. 7
Question 7
Question
Evaluate for a = 5, b = 4, c = 3, d = 12 for the equation E = a*b+d/c
Answer
-
A. 40
-
B. 24
-
C. 10
-
D. 10.66
Question 8
Question
Evaluate for the equation e = 5*a\d*(b+1) where a = 5, b = 4, c = 3, d = 12
Question 9
Question
The most important reason for including a destructor in a class is:
Answer
-
A. To print a message for debugging purposes
-
B. To store information about an object before it goes out of scope
-
C. To free up resources allocated by that class
-
D. To reset the original object's pointer to NULL
-
E. To make your TA happy
Question 10
Question
Which of the following name does not relate to stacks?
Answer
-
A. FIFO lists
-
B. LIFO list
-
C. Piles
-
D. Push-down lists
Question 11
Question
Which of the following data structure is linear type?
Answer
-
A. Strings
-
B. Lists
-
C. Queues
-
D. All of above
Question 12
Question
An algorithm that calls itself directly or indirectly is known as
Answer
-
A. Sub algorithm
-
B. Recursion
-
C. Polish notation
-
D. Traversal algorithm
Question 13
Question
The help menus or user manuals are the part of ____.
Question 14
Question
The correctness and appropriateness of ___ solution can be checked very easily.
Answer
-
A. algorithmic solution
-
B. heuristic solution
-
C. random solution
-
D. none of these
Question 15
Answer
-
A. To store previous results for future use
-
B. To avoid this unnecessary repetitions by writing down the results of recursive calls and looking them up again if we need them later
-
C. To make the process accurate
-
D. None of the above
Question 16
Question
The time complexity of linear search is _____.
Answer
-
A. O(1)
-
B. O(log(n))
-
C. O(n)
-
D. O(n log(n))
Question 17
Question
The time complexity of binary search is _____.
Answer
-
A. O(1)
-
B. O(log(n))
-
C. O(n)
-
D. O(n log(n))
Question 18
Question
What is the asymptotic runtime for traversing all nodes in a binary search tree with n nodes and printing them in order?
Answer
-
A. O(n log(n))
-
B. O(n)
-
D. O(log(n))
-
E. O(n^2)
Question 19
Question
The number of nodes in a complete binary tree of height h is
Answer
-
A. 2^(h+1) - 1
-
B. 2*(h+1) - 1
-
C. 2*(h+1)
-
D. (h+1)^2 - 1
Question 20
Question
Divide-and-conquer as breaking the problem into a small number of
Answer
-
A. Pivot
-
B. Sieve
-
C. Smaller sub problems
-
D. Selection
Question 21
Question
The sub problems in Divide and Conquer are considered to be
Answer
-
A. Distinct
-
B. Overlapping
-
C. Large size
-
D. Small size
Question 22
Question
For the sieve technique we solve the problem,
Answer
-
A. recursively
-
B. mathematically
-
C. precisely
-
D. accurately
Question 23
Question
The sieve technique works in ____ as follows
Answer
-
A. phases
-
B. numbers
-
C. integers
-
D. routines
Question 24
Question
The sieve technique is a special case, where the number of sub problems is just
Question 25
Question
The reason for introducing Sieve Technique algorithm is that it illustrates a very important special case of,
Answer
-
A. divide-and-conquer
-
B. decrease and conquer
-
C. greedy nature
-
D. 2-dimension Maxima
Question 26
Question
Sieve Technique applies to problems where we are interested in finding a single item from a larger set of ____
Answer
-
A. n items
-
B. phases
-
C. pointers
-
D. constant
Question 27
Question
In Sieve Technique we do not know which item is of interest
Question 28
Question
For the Sieve Technique we take time
Answer
-
A. T(nk)
-
B. T(n / 3)
-
C. n^2
-
D. n/3
Question 29
Question
How many passes are required to sort a file of size n by bubble sort method?
Question 30
Question
The worst-case time complexity of Bubble Sort is ____.
Answer
-
A. O(n2)
-
B. O(log n)
-
C. O(n)
-
D. O(n log(n))
Question 31
Question
Which of the following sorting procedures is the slowest?
Answer
-
A. Quick sort
-
B. Heap sort
-
C. Shell sort
-
D. Bubble sort
Question 32
Question
For i = 1 to n-1 do --> For j = 1 to n-1-i do --> If (a[j+1] < a[j]) then swap a[j] and a[j+1]. Given code is for
Answer
-
A. Bubble sort
-
B. Insertion sort
-
C. Quick Sort
-
D. Selection Sort
Question 33
Question
How many number of comparisons are required in insertion sort to sort a file if the file is sorted in reverse order?
Question 34
Question
How many number of comparisons are required in insertion sort to sort a file if the file is already sorted?
Question 35
Question
Which of the following sorting methods would be most suitable for sorting a list which is almost sorted?
Answer
-
A. Bubble Sort
-
B. Insertion Sort
-
C. Selection Sort
-
D. Quick Sort
Question 36
Question
!!!
Suppose we are sorting an array of eight integers using some quadratic sorting algorithm. After four iterations of the algorithm's main loop, the array elements are ordered as shown here: 2 4 5 7 8 1 3 6
Answer
-
A. Insertion sort
-
B. Selection sort
-
C. Either of a and b
-
D. None of the above
Question 37
Question
The running time of insertion sort is
Answer
-
A. O(n^2)
-
B. O(n)
-
C. O(log(n))
-
D. O(n log(n))
Question 38
Question
A sort which compares adjacent elements in a list and switches where necessary is ____.
Answer
-
A. insertion sort
-
B. heap sort
-
C. quick sort
-
D. bubble sort
Question 39
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
-
A. insertion sort
-
B. selection sort
-
C. heap sort
-
D. quick sort
Question 40
Question
The way a card game player arranges his cards as he picks them one by one can be compared to
Answer
-
A. Quick sort
-
B. Merge sort
-
C. Insertion sort
-
D. Bubble sort
Question 41
Question
Which among the following is the best when the list is already sorted?
Answer
-
A. Insertion sort
-
B. Bubble sort
-
C. Merge sort
-
D. Selection sort
Question 42
Question
As part of the maintenance work, you are entrusted with the work of rearranging the library books in a shelf in proper order, at the end of each day. The ideal choice will be
Answer
-
A. Bubble sort
-
B. Insertion sort
-
C. Selection sort
-
D. Merge sort
Question 43
Question
When is insertion sort a good choice for sorting an array?
Answer
-
A. Each component of the array requires a large amount of memory.
-
B. The processor speed is fast.
-
C. Each component of the array requires a small amount of memory.
-
D. The array has only a few items out of place.
Question 44
Question
Suppose we are sorting an array of ten integers using a some quadratic sorting algorithm. After four iterations of the algorithm's main loop, the array elements are ordered as shown here: 1 2 3 4 5 0 6 7 8 9. Which statement is correct? (Note: Our selection sort picks largest items first)
Answer
-
A. The algorithm might be either selection sort or insertion sort.
-
B. The algorithm is neither selection sort nor insertion sort.
-
C. The algorithm might be selection sort, but could not be insertion sort.
-
D. The algorithm might be insertion sort, but could not be selection sort.
Question 45
Question
A list of n strings, each of length n, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is
Answer
-
A. O (n log(n))
-
B. O (n^2 log(n))
-
C. O (n^2 + log(n))
-
D. O (n^2)
Question 46
Question
The worst-case time complexity of Merge Sort is ____.
Answer
-
A. O(n^2)
-
B. O(log n)
-
C. O(n)
-
D. O(n log(n))
Question 47
Question
Suppose we need to sort a list of employee records in ascending order, using the social security number (a 9-digit number) as the key (i.e., sort the records by social security number). If we need to guarantee that the running time will be no worse than n*log(n), which sorting methods could we use?
Question 48
Question
How much time merge sort takes for an array of numbers?
Answer
-
A. T(n^2)
-
B. T(n)
-
C. T(log n)
-
D. T(n log(n))
Question 49
Question
Merge sort makes two recursive calls. Which statement is true after these recursive calls finish, but before the merge step?
Answer
-
A. The array elements form a heap.
-
B. None of the above.
-
C. Elements in each half of the array are sorted amongst themselves.
-
D. Elements in the first half of the array are less than or equal to elements in the second half of the array.
Question 50
Question
What is the worst-case time for merge sort to sort an array of n elements?
Answer
-
A. O(n)
-
B. O(n log(n))
-
C. O(log(n))
-
D. O(n)
Question 51
Question
In quick sort, the number of partitions into which the file of size n is divided by a selected record is
Answer
-
A. n
-
B. n - 1
-
C. 2
-
D. n/2
Question 52
Question
The worst-case time complexity of Quick Sort is ____.
Answer
-
A. O(n^2)
-
B. O(log(n))
-
C. O(n)
-
D. O(n log(n))
Question 53
Question
The algorithm like Quick sort does not require extra memory for carrying out the sorting procedure. This technique is called ____.
Answer
-
A. in-place
-
B. stable
-
C. unstable
-
D. in-partition
Question 54
Question
In quick sort, the number of partitions into which the file of size n is divided by a selected record is
Answer
-
A. n
-
B. n - 1
-
C. 2
-
D. None of the above
Question 55
Question
The total number of comparisons made in quick sort for sorting a file of size n, is
Answer
-
A. O(n log(n))
-
B. O(n^2)
-
C. n(log(n))
-
D. None of the above
Question 56
Question
Quick sort efficiency can be improved by adopting
Answer
-
A. non-recursive method
-
B. insertion method
-
C. tree search method
-
D. None of the above
Question 57
Question
For the improvement of efficiency of quick sort the pivot can be
Answer
-
A. the first element
-
B. the mean element
-
C. the last element
-
D. None of the above
Question 58
Question
Quick sort is the fastest available method of sorting because of
Question 59
Answer
-
A. Stable & in place
-
B. Not stable but in place
-
C. Stable but not in place
-
D. Some time stable & some times in place
Question 60
Question
One example of in place but not stable algorithm is
Answer
-
A. Merger Sort
-
B. Quick Sort
-
C. Continuation Sort
-
D. Bubble Sort
Question 61
Question
In Quick Sort Constants hidden in T(n log n) are
Answer
-
A. Large
-
B. Medium
-
C. Small
-
D. Not Known
Question 62
Question
The running time of quick sort depends heavily on the selection of
Question 63
Question
!!!!!!
Here is an array which has just been partitioned by the first step of quick sort: 3, 0, 2, 1, 5, 4, 7, 9, 8. Which of these elements could be the pivot?
Question 64
Question
Quick sort is solved using
Answer
-
A. Divide and conquer
-
B. Greedy Programming
-
C. Dynamic Programming
-
D. Branch and bound
Question 65
Question
The worst-case time complexity of Selection Exchange Sort is ____.
Answer
-
A. O(n^2)
-
B. O(log n)
-
C. O(n)
-
D. O(n log(n))
Question 66
Question
Straight selection sort is basically a method of repeated
Answer
-
A. interchange
-
B. searching
-
C. position adjustment
-
D. None of the above
Question 67
Question
Number of selections required to sort a file of size N by straight selection requires
Answer
-
A. n-1
-
B. log(n)
-
C. O(n^2)
-
D. None of the above
Question 68
Question
For sorting a file of size n by straight selection sort, the number of comparisons made in the first pass is
Answer
-
A. n
-
B. n - 1
-
C. n(n - 1)/2
-
D. None of the above
Question 69
Question
""
In the analysis of Selection algorithm, we eliminate a constant fraction of the array with each phase; we get the convergent ____ series in the analysis
Answer
-
A. linear
-
B. arithmetic
-
C. geometric
-
D. exponent
Question 70
Question
??
In the analysis of Selection algorithm, we make a number of passes, in fact it could be as many as,
Answer
-
A. T(n)
-
B. T(n/2)
-
C. log n
-
D. n/2 + n/4
Question 71
Question
??
Analysis of Selection algorithm ends up with
Answer
-
A. T(n)
-
B. T(1/1 + n)
-
C. T(n/2)
-
D. T(n/2 + n)
Question 72
Question
The analysis of Selection algorithm shows the total running time is indeed ____ in n,
Answer
-
A. arithmetic
-
B. geometric
-
C. linear
-
D. orthogonal
Question 73
Question
How many elements do we eliminate in each time for the Analysis of Selection algorithm?
Answer
-
A. n/2 elements
-
B. n/2 + n elements
-
C. n/4 elements
-
D. 2n elements
Question 74
Question
In a selection sort of n elements, how many times is the swap function called in the complete execution of the algorithm?
Answer
-
A. 1
-
B. n-1
-
C. n log(n)
-
D. n^2
Question 75
Question
Selection sort and quick sort both fall into the same category of sorting algorithms. What is this category?
Question 76
Question
Slow sorting algorithms run in
Answer
-
A. T(n^2)
-
B. T(n)
-
C. T(log(n))
Question 77
Question
A sort technique is said to be stable when the original relative order of records with equal keys are retained after sorting.
Question 78
Question
The three factors contributing to the sort efficiency considerations are the efficiency in coding, machine run time and the space requirement for running the procedure.
Question 79
Question
The correct order of the efficiency of the following sorting algorithms according to their overall running time comparison is
Answer
-
A. Insertion > Selection > Bubble
-
B. Insertion > Bubble > Selection
-
C. Selection > Bubble > Insertion
-
D. Bubble > Selection > Insertion
Question 80
Question
In which order we can sort?
Question 81
Question
Which sorting algorithm is faster
Answer
-
A. O(n log(n))
-
B. O(n^2)
-
C. O(n+k)
-
D. O(n^3)
Question 82
Question
Continuation sort is suitable to sort the elements in range 1 to k
Question 83
Question
In stable sorting algorithm.
Answer
-
A. If duplicate elements remain in the same relative position after sorting
-
B. One array is used
-
C. More than one arrays are required
-
D. Duplicating elements not handled
Question 84
Question
Which may be a stable sort?
Answer
-
A. Merger
-
B. Insertion
-
C. Both above
-
D. None of the above
Question 85
Question
An in place sorting algorithm is one that uses ___ arrays for storage
Question 86
Question
We do sorting to
Answer
-
A. keep elements in random positions
-
B. keep the algorithm run in linear order
-
C. keep the algorithm run in (log n) order
-
D. keep elements in increasing or decreasing order
Question 87
Question
Sorting is one of the few problems where provable ____ bonds exits on how fast we can sort
Answer
-
A. upper
-
B. lower
-
C. average
-
D. log n
Question 88
Question
In in-place sorting algorithm is one that uses arrays for storage
Question 89
Question
Which may be stable sort
Answer
-
A. Bubble sort
-
B. Insertion sort
-
C. Both of above
-
D. None of above
Question 90
Question
The operation of processing each element in the list is known as
Answer
-
A. sorting
-
B. merging
-
C. inserting
-
D. traversal
Question 91
Question
Other name for directed graph is
Answer
-
A. Direct graph
-
B. Digraph
-
C. Dir-graph
Question 92
Question
Binary trees with threads are called as
Answer
-
A. Threaded trees
-
B. Pointer trees
-
C. Special trees
-
D. Special pointer trees
Question 93
Question
Graph G is ____ if for any pair u, v of nodes in G there is a path from u to v or path from v to u.
Answer
-
A. Leterally connected
-
B. Widely Connected
-
C. Unliterally connected
-
D. Literally connected
Question 94
Question
In Binary trees nodes with no successor are called
Answer
-
A. End nodes
-
B. Terminal nodes
-
C. Final nodes
-
D. Last nodes
Question 95
Question
A connected graph T without any cycles is called
Answer
-
A. free graph
-
B. no cycle graph
-
C. non cycle graph
-
D. circular graph
Question 96
Question
Trees are said ____ if they are similar and have same contents at corresponding nodes.
Answer
-
A. Duplicate
-
B. Carbon copy
-
C. Replica
-
D. Copies
Question 97
Question
Every node N in a binary tree T except the root has a unique parent called the ____ of N.
Answer
-
A. Antecedents
-
B. Predecessor
-
C. Forerunner
-
D. Precursor
Question 98
Question
In a graph if E=(u,v) means
Answer
-
A. u is adjacent to v but v is not adjacent to u
-
B. e begins at u and ends at v
-
C. u is processor and v is successor
-
D. both b and c
Question 99
Question
Sequential representation of binary tree uses
Question 100
Question
In a graph if e=[u,v], Then u and v are called
Answer
-
A. End points of e
-
B. Adjacent nodes
-
C. Neighbours
-
D. All of the above
Question 101
Question
TREE[1]=NULL indicates tree is
Answer
-
A. Overflow
-
B. Underflow
-
C. Empty
-
D. Full
Question 102
Question
A binary tree whose every node has either zero or two children is called
Answer
-
A. complete binary tree
-
B. binary search tree
-
C. extended binary tree
-
D. data structure
Question 103
Question
Linked representation of binary tree needs ____ parallel arrays.
Question 104
Question
The depth of complete binary tree is given by
Answer
-
A. D(n) = n log(n)
-
B. D(n) = n log(n)+1
-
C. D(n) = log(n)
-
D. D(n) = log(n)+1
Question 105
Question
In a 2-tree, nodes with 0 children are called
Answer
-
A. Exterior node
-
B. Outside node
-
C. Outer node
-
D. External node
Question 106
Question
Which indicates pre-order traversal?
Answer
-
A. Left sub-tree, Right sub-tree and root
-
B. Right sub-tree, Left sub-tree and root
-
C. Root, Left sub-tree, Right sub-tree
-
D. Right sub-tree, root, Left sub-tree
Question 107
Question
In a extended-binary tree nodes with 2 children are called
Answer
-
A. Interior node
-
B. Domestic node
-
C. Internal node
-
D. Inner node
Question 108
Question
A terminal node in a binary tree is called
Answer
-
A. Root
-
B. Leaf
-
C. Child
-
D. Branch
Question 109
Question
The post order traversal of binary tree is DEBFCA. Find out the pre order traversal.
Answer
-
A. ABFCDE
-
B. ADBFEC
-
C. ABDECF
-
D. ABDCEF
Question 110
Question
While converting binary tree into extended binary tree, all the original nodes in binary tree are
Answer
-
A. Internal nodes on extended tree
-
B. External nodes on extended tree
-
C. Vanished on extended tree
-
D. Intermediate nodes on extended tree
Question 111
Question
The in-order traversal of tree will yield a sorted listing of elements of tree in
Answer
-
A. binary trees
-
B. binary search trees
-
C. heaps
-
D. binary heaps
Question 112
Question
In a binary tree, certain null entries are replaced by special pointers which point to nodes higher in the tree for efficiency. These special pointers are called
Answer
-
A. Leaf
-
B. Branch
-
C. Path
-
D. Thread
Question 113
Question 114
Question
The in order traversal of tree will yield a sorted listing of elements of tree in
Answer
-
A. Binary trees
-
B. Binary search trees
-
C. Merging
-
D. AVL Trees
Question 115
Question
In a graph if e=(u,v) means
Answer
-
A. u is adjacent to v but v is not adjacent to u.
-
B. e begins at u and ends at v
-
C. u is node and v is an edge.
-
D. both u and v are edges.
Question 116
Question
A binary tree whose every node has either zero or two children is called
Answer
-
A. Complete binary tree
-
B. Binary Search tree
-
C. Extended binary tree
-
D. E2 tree
Question 117
Question
If every node u in G is adjacent to every other node v in G,A graph is said to be
Answer
-
A. isolated
-
B. complete
-
C. finite
-
D. strongly connected
Question 118
Question
The post order traversal of a binary tree is DEBFCA. Find out the pre order Traversal.
Answer
-
A. ABFCDE
-
B. ADBFEC
-
C. ABDECF
-
D. ABDCEF
Question 119
Question
In a graph if e=[u,v], then u and v are called
Answer
-
A. endpoints of e
-
B. adjacent nodes
-
C. neighbours
-
D. all of the above
Question 120
Question
In-order traversing a tree resulted E A C K F H D B G; the pre-order traversal would return.
Answer
-
A. FAEKCDBHG
-
B. FAEKCDHGB
-
C. EAFKHDCBG
-
D. FEAKDCHBG
Question 121
Question
In linked representation of Binary trees LEFT[k] contains the ____ of at the node N, where k is the location.
Question 122
Question
If every node u in G adjacent to every other node v in G, A graph is said to be
Answer
-
A. isolated
-
B. complete
-
C. finite
-
D. strongly connected
Question 123
Question
Three standards ways of traversing a binary tree T with root R
Answer
-
A. Prefix, infix, postfix
-
B. Pre-process, in-process, post-process
-
C. Pre-traversal, in-traversal, post-traversal
-
D. Pre-order, in-order, post-order
Question 124
Question
A graph is said to be ____ if every node u in G is adjacent to every other node v in G.
Answer
-
A. Absolute
-
B. Entire
-
C. Inclusive
-
D. Complete
Question 125
Question
In threaded binary tree ____ points to higher nodes in tree.
Answer
-
A. Info
-
B. Root
-
C. Threads
-
D. Child
Question 126
Question
A graph is said to be ____ if its edges are assigned data.
Answer
-
A. Tagged
-
B. Marked
-
C. Weighted
-
D. Sticked
Question 127
Question
If node N is a terminal node in a binary tree then its
Question 128
Question
A directed graph is ____ if there is a path from each vertex to every other vertex in the digraph.
Answer
-
A. Weakly connected
-
B. Strongly Connected
-
C. Tightly Connected
-
D. Linearly Connected
Question 129
Question
In the ____ traversal we process all of a vertex's descendants before we move to an adjacent vertex.
Answer
-
A. Depth First
-
B. Breadth First
-
C. With First
-
D. Depth Limited
Question 130
Question
State True of False. (I) Network is a graph that has weights or costs associated with it. (II) An undirected graph which contains no cycles is called a forest. (III) A graph is said to be complete if there is no edge between every pair of vertices.
Answer
-
A. True, False, True
-
B. True, True, False
-
C. True, True, True
-
D. False, True, True
Question 131
Question
The number of comparisons done by sequential search is
Answer
-
A. (N/2)+1
-
B. (N+1)/2
-
C. (N-1)/2
-
D. (N+2)/2
Question 132
Question
In ____, search start at the beginning of the list and check every element in the list.
Answer
-
A. Linear search
-
B. Binary search
-
C. Hash Search
-
D. Binary Tree search
Question 133
Question
State True or False. (I) Binary search is used for searching in a sorted array. (II) The time complexity of binary search is O(logn).
Answer
-
A. True, False
-
B. False, True
-
C. False, False
-
D. True, True
Question 134
Question
Which of the following is not the internal sort?
Answer
-
A. Insertion Sort
-
B. Bubble Sort
-
C. Merge Sort
-
D. Heap Sort
Question 135
Question
State True or False. (I) An undirected graph which contains no cycles is called forest. (II) A graph is said to be complete if there is an edge between every pair of vertices.
Answer
-
A. True, True
-
B. False, True
-
C. False, False
-
D. True, False
Question 136
Question
A graph is said to be ____ if the vertices can be split into two sets V1 and V2 such there are no edges between two vertices of V1 or two vertices of V2.
Answer
-
A. Partite
-
B. Bipartite
-
C. Rooted
-
D. Bisects
Question 137
Question
In a queue, the initial values of front pointer f rare pointer r should be ____ and ____ respectively.
Answer
-
A. 0 and 1
-
B. 0 and -1
-
C. -1 and 0
-
D. 1 and 0
Question 138
Question
In a circular queue the value of r will be
Question 139
Question
Which of the following statement is true? (I) Using singly linked lists and circular list, it is not possible to traverse the list backwards. (II) To find the predecessor, it is required to traverse the list from the first node in case of singly linked list.
Answer
-
A. I-only
-
B. II-only
-
C. Both I and II
-
D. None of both
Question 140
Question
The advantage of ____ is that they solve the problem if sequential storage representation. But disadvantage in that is they are sequential lists.
Answer
-
A. Lists
-
B. Linked Lists
-
C. Trees
-
D. Queues
Question 141
Question
What will be the value of top, if there is a size of stack STACK_SIZE is 5
Question 142
Question
____ is not the operation that can be performed on queue.
Answer
-
A. Insertion
-
B. Deletion
-
C. Retrieval
-
D. Traversal
Question 143
Question
There is an extra element at the head of the list called a
Answer
-
A. Antinel
-
B. Sentinel
-
C. List header
-
D. List head
Question 144
Question
A graph is a collection of nodes, called ____ And line segments called arcs or ____ that connect pair of nodes.
Answer
-
A. vertices, edges
-
B. edges, vertices
-
C. vertices, paths
-
D. graph node, edges
Question 145
Question
A ____ is a graph that has weights of costs associated with its edges.
Answer
-
A. Network
-
B. Weighted graph
-
C. Both A and B
-
D. None A and B
Question 146
Question
In general, the binary search method needs no more than ____ comparisons.
Answer
-
A. [log2n]-1
-
B. [logn]+1
-
C. [log2n]
-
D. [log2n]+1
Question 147
Question
In depth first search algorithm the number of recursive calls we have to make are
Answer
-
A. 2
-
B. 1
-
C. 6
-
D. depends on the graph
Question 148
Question
In a graph if e=(u,v) means
Answer
-
A. u is adjacent to v but v is not adjacent to u
-
B. e begins at u and ends at v
-
C. u is processor and v is successor
-
D. both b and c
Question 149
Question
Heap is defined to be a
Answer
-
A. complete binary tree
-
B. binary tree
-
C. tree structure
-
D. None of the above
Question 150
Question
In a Max heap the largest key is at
Answer
-
A. the root
-
B. a leaf
-
C. a node
-
D. None of the above
Question 151
Question
In heap sort the input is arranged in the form of a
Answer
-
A. heap
-
B. tree
-
C. queue
-
D. None of the above
Question 152
Question
Heap sort is found to be very efficient
Question 153
Question
For the heap sort, access to nodes involves simple ____ operations
Answer
-
A. arithmetic
-
B. binary
-
C. algebraic
-
D. logarithmic
Question 154
Question
A (an) ____ is a left-complete binary tree that conforms to the heap order
Answer
-
A. heap
-
B. binary tree
-
C. binary search tree
-
D. array
Question 155
Question
For the heap sort we store the tree nodes in
Answer
-
A. level-order traversal
-
B. in-order traversal
-
C. pre-order traversal
-
D. post-order traversal
Question 156
Question
One of the clever aspects of heaps is that they can be stored in arrays without using any ____.
Answer
-
A. pointers
-
B. constants
-
C. variables
-
D. functions
Question 157
Question
Assuming that the hash function for a table works well, and the size of the hash table is reasonably large compared to the number of items in the table, the expected (average) time needed to find an item in a hash table containing n items is
Answer
-
A. O(1)
-
B. O(log(n))
-
C. O(n log(n))
-
D. O(n)
Question 158
Question
The six-step solution for the problem can be applied to problems (I) with Algorithmic solution or (II) with Heuristic solution
Answer
-
A. Only I
-
B. Only II
-
C. Both I and II
-
D. Neither I nor II
Question 159
Question
____ solution requires reasoning built on knowledge and experience
Answer
-
A. Algorithmic Solution
-
B. Heuristic Solution
-
C. Random Solution
-
D. None of these
Question 160
Question
The branch of computer that deals with heuristic types of problem is called ____.
Question 161
Question
___ is the first step in solving the problem
Question 162
Question
___ is the last step in solving the problem
Question 163
Question
Following is true for understanding of a problem
Answer
-
A. Knowing the knowledgebase
-
B. Understanding the subject on which the problem is based
-
C. Communication with the client
-
D. All of the above
Question 164
Question
While solving the problem with computer the most difficult step is ____.
Answer
-
A. describing the problem
-
B. finding out the cost of the software
-
C. writing the computer instructions
-
D. testing the solution
Question 165
Question
The main measure for efficiency algorithm are ____.
Answer
-
A. Processor and Memory
-
B. Size and Capacity
-
C. Data and Space
-
D. Time and Space
Question 166
Question
What does the algorithmic analysis count?
Answer
-
A. The number of arithmetic and the operations that are required to run the program
-
B. The number of lines required by the program
-
C. The number of seconds required by the program to execute
-
D. None of these
Question 167
Question
!!!
Examples of O(1) algorithms are ____.
Answer
-
A. Multiplying two numbers
-
B. Assigning some value to a variable
-
C. Displaying some integer on console
-
D. All of the above
Question 168
Question
Examples of O(n^2) algorithms are ____.
Question 169
Question
The complexity of three algorithms is given as: O(n), O(n^2) and O(n^3). Which should execute slowest for large value of n?
Question 170
Question
There are four algorithms A1, A2, A3, A4 to solve the given problem with the order log(n), nlog(n), log(log(n)), n/log(n). Which is the best algorithm?
Answer
-
A. A1: log(n)
-
B. A2: n log(n)
-
C. A3: log(log(n))
-
D. A4: n/log(n)
Question 171
Question
Express the formula (n-1)*(n-5) in terms of big-Oh notation
Answer
-
A. O(1)
-
B. O(log(n))
-
C. O(n)
-
D. O(n^2)
Question 172
Question
Which of the following case does not exist in complexity theory?
Answer
-
A. Best case
-
B. Worst case
-
C. Average case
-
D. Null case
Question 173
Question
The concept of order Big-Oh is important because
Answer
-
A. It can be used to decide the best algorithm that solves a given problem
-
B. It determines the maximum size of a problem that can be solved in a given amount of time
-
C. It is the lower bound of the growth rate of algorithm
-
D. Both A and B
Question 174
Question
The recurrence relation capturing the optimal execution time of the Towers of Hanoi problem with n discs is
Answer
-
A. T(n) = 2T(n - 2) + 2
-
B. T(n) = 2T(n - 1) + n
-
C. T(n) = 2T(n/2) + 1
-
D. T(n) = 2T(n - 1) + 1
Question 175
Question
The space factor when determining the efficiency of algorithm is measured by
Answer
-
A. Counting the maximum memory needed by the algorithm
-
B. Counting the minimum memory needed by the algorithm
-
C. Counting the average memory needed by the algorithm
-
D. Counting the maximum disk space needed by the algorithm
Question 176
Question
The time factor when determining the efficiency of algorithm is measured by
Answer
-
A. Counting microseconds
-
B. Counting the number of key operations
-
C. Counting the number of statements
-
D. Counting the kilobytes of algorithm
Question 177
Question
A large department store has its own charge card. The policy for a customer to charge an item is that the customer must have a valid charge card and either a balance of less than Rs.500 or a charge of less than Rs.50.
Answer
-
A. ChargeCard AND (Balance < 500 OR Amount < 50)
-
B. ChargeCard OR (Balance < 500 AND Amount < 50)
-
C. ChargeCard OR (Balance < 500 OR Amount < 50)
-
D. ChargeCard AND (Balance < 500 AND Amount < 50)
Question 178
Question
If Total complexity after analysis is (5n^3 + 10n^2 + 100n + 400log(n) + 10), the Big-Oh complexity is
Answer
-
A. O(n^2)
-
B. O(n^3)
-
C. O(n log(n))
-
D. O(n^2 log(n))
Question 179
Question
In Strassen's Multiplication Algorithm the T(n) is
Answer
-
A. 7T(n) + bn^2
-
B. 7T(n/2) + bn^2
-
C. 8T(n/2) + bn^2
-
D. 7T(n/2) + bn
Question 180
Question
T(n) = 4T(n/2) + n, then in Big Oh Notation it is
Answer
-
A. O (n2)
-
B. O(4)
-
C. O(n)
-
D. O(log(n))
Question 181
Question
In T(n) = a * T(n/b) + f(n), "a" refers to
Question 182
Question
O(f(n)) minus O(f(n)) is equal to
Answer
-
A. Zero
-
B. A constant
-
C. f(n)
-
D. O(f(n))