Select the correct option to test your answer:
More Computer Questions
What is the role of the Hadoop Security Manager in a Hadoop cluster?
Consider the following code snippet function printprops ( o ) { for(var p in o ) console . log ( p + ": " + o [ p ] + "n" ) ; } What will the above code snippet result ?
What is the value stored in arr[2][3] when the following code is executed? #include<stdio.h> #include<limits.h> int mat_chain_multiplication(int *mat, int n) { int arr[n][n]; int i,k,row,col,len; for(i=1;i<n;i++) arr[i][i] = 0; for(len = 2; len < n; len++) { for(row = 1; row <= n - len + 1; row++) { col = row + len - 1; arr[row][col] = INT_MAX; for(k = row; k <= col - 1; k++) { int tmp = arr[row][k] + arr[k + 1][col] + mat[row - 1] * mat[k] * mat[col]; if(tmp < arr[row][col]) arr[row][col] = tmp; } } } return arr[1][n - 1]; } int main() { int mat[6] = {20,30,40,50}; int ans = mat_chain_multiplication(mat,4); printf("%d",ans); return 0; }
What will be the output of the following C# code? namespace ConsoleApplication4 { abstract class A { public int i; public abstract void display(); } class B: A { public int j; public int sum; public override void display() { sum = i + j; Console.WriteLine(+i + "\n" + +j); Console.WriteLine("sum is:" +sum); } } class Program { static void Main(string[] args) { A obj = new B(); obj.i = 2; B obj1 = new B(); obj1.j = 10; obj.display(); Console.ReadLine(); } } }
What will be the auxiliary space complexity of the following code? #include <bits/stdc++.h> using namespace std; void convert(int arr[], int n) { int temp[n]; memcpy(temp, arr, n*sizeof(int)); sort(temp, temp + n); unordered_map<int, int> map; int sort_index = 0; for (int i = 0; i < n; i++) map[temp[i]] = sort_index++; for (int i = 0; i < n; i++) arr[i] = map[arr[i]]; } void printArr(int arr[], int n) { for (int i=0; i<n; i++) cout << arr[i] << " "; } int main() { int arr[] = {10, 20, 15, 12, 11, 50}; int n = sizeof(arr)/sizeof(arr[0]); convert(arr , n); printArr(arr, n); return 0; }