сұрақ |
жауап |
Suppose we want to arrange the n numbers stored in an array such that all negative values occur before all positive ones. The minimum number of exchanges required in the worst case is: оқуды бастаңыз
|
|
|
|
|
The time complexity of linear search is given by: оқуды бастаңыз
|
|
|
|
|
a = 0 N=1000 for i in range(0, N,1): for j in range(N, 0,-1): a = a + i + j; print(a) The running time is: оқуды бастаңыз
|
|
|
|
|
The complexity of recursive Fibonacci series is оқуды бастаңыз
|
|
|
|
|
N=5 a = 0 i = N while (i > 0): a = a + i; i = i/2; The running time is: оқуды бастаңыз
|
|
|
|
|
Consider the following function: T(n) = n if n ≤ 3 T(n) = T(n-1) + T(n-2) - T(n-3) otherwise The running time is: оқуды бастаңыз
|
|
|
|
|
The time complexity of an algorithm T(n), where n is the input size, is given by T(n) = T(n - 1) + 1/n if n > 1 The order of this algorithm is оқуды бастаңыз
|
|
|
|
|
Which of the following best describes the useful criterion for comparing the efficiency of algorithms? оқуды бастаңыз
|
|
|
|
|
Which of the following is not O(n2)? оқуды бастаңыз
|
|
|
|
|
Suppose T(n) = 2T(n/2) + n, T(0) = T(1) = 1 Which one of the following is false оқуды бастаңыз
|
|
|
|
|
The following statement is valid. log(n!) = \theta (n log n). оқуды бастаңыз
|
|
|
|
|
To verify whether a function grows faster or slower than the other function, we have some asymptotic or mathematical notations, which is_________. оқуды бастаңыз
|
|
Big Omega Ω (f), Big Oh O (f), Big Theta θ (f)
|
|
|
An algorithm performs lesser number of operations when the size of input is small, but performs more operations when the size of input gets larger. State if the statement is True or False or Maybe. оқуды бастаңыз
|
|
|
|
|
An algorithm that requires ........ operations to complete its task on n data elements is said to have a linear runtime. оқуды бастаңыз
|
|
|
|
|
The complexity of adding two matrices of order m*n is оқуды бастаңыз
|
|
|
|
|
The order of an algorithm that finds whether a given Boolean function of 'n' variables, produces a 1 is оқуды бастаңыз
|
|
|
|
|
The concept of order (Big O) is important because оқуды бастаңыз
|
|
|
|
|
When we say an olgorithm has a time complexity of O(n), what does it mean? оқуды бастаңыз
|
|
The computation time taken by the algorithm is proportional to n
|
|
|
What is recurrence for worst case of QuickSort and what is the time complexity in Worst case? оқуды бастаңыз
|
|
Recurrence is T(n) = T(n-1) + O(n) and time complexity is O(n^2)
|
|
|
Suppose we are sorting an array of eight integers using quicksort, and we have just finished the first partitioning with the array looking like this: 2 5 1 7 9 12 11 10 Which statement is correct? оқуды бастаңыз
|
|
The pivot could be either the 7 or the 9.
|
|
|
Which of the following is not an in-place sorting algorithm? оқуды бастаңыз
|
|
|
|
|
Running merge sort on an array of size n which is already sorted is оқуды бастаңыз
|
|
|
|
|
оқуды бастаңыз
|
|
|
|
|
Which of the following algorithm design technique is used in the quick sort algorithm? оқуды бастаңыз
|
|
|
|
|