Answer:
Merge sort is sort, which contains the same elements in the array to maintain original positions concerning each other. Complexity of sort is O (nLogn) and runtime is O(nlogn)
Explanation:
Estimate time spent on presorting an array 101 element in merge and binary search, two schemes can be used in the first scheme if 101 items in sequential search then use the complexity of O(n). In the second scheme covert, the list into an array then sort an array with the complexity of O(n log n) and fetch the 101 elements.
Merge 101 elements; presorted sub-array n items have to compare the top times in sub-array and choose the maximum item and place it in a sorted array. Time for merging is proportional to ( k-1) n.
Suppose the processing time of the merger is c.(k-1) .n then scale factor has the same value.
The processing time of a sorting array is a recurrence equation.
T(n) = 3T (n/3) + 2 cn
Similarly this implement for array of 105 element.
The answer is True. To add artwork to a slide, the slide must contain a placeholder. <span>Once </span>artwork<span> is inserted into a </span>placeholder<span>, it can be moved around the </span>slide<span>.</span>
Answer:
The function in C++ is as follows:
int isSorted(int ar[], int n){
if (
||
){
return 1;}
if (
<
){
return 0;}
return isSorted(ar, n - 1);}
Explanation:
This defines the function
int isSorted(int ar[], int n){
This represents the base case; n = 1 or 0 will return 1 (i.e. the array is sorted)
if (
||
){
return 1;}
This checks if the current element is less than the previous array element; If yes, the array is not sorted
if (
<
){
return 0;}
This calls the function, recursively
return isSorted(ar, n - 1);
}
Answer:
public class Calculator {
public double add(int a, int b){
return a+b;
}
public double substract(int a, int b){
return a-b;
}
public double multiply(int a, int b){
return a*b;
}
public double divide(int a, int b){
if(b>0){
return a/b;
}
else{
System.out.println("Cannot divide by zero");
}
return -1;
}
}
Explanation:
- Using Java Programming Language, the class Calculator is created. There are no fields (Instance variables) and no constructors since these are not required by the question.
- Four methods (functions) are created: add, substract, multiply and divide as specified in the question.
- Note the use of the if statement in the divide() to handle case of illegal division (by 0)
Answer:
a wide area network is also known as (WAN) it is a large information that has been tied to more than a single location you can understand by the diagram shown you can think of it as a network sharing information around the world