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