331. In an election contested by two parties, Party D secured 12% of the total votes more than Party R. If party R got 132,000 votes, by how many votes did it lose the election?
Answer: 36000
Explanation:Let the percentage of the total votes secured by Party D be x%
Then the percentage of total votes secured by Party R = (x – 12)%
As there are only two parties contesting in the election, the sum total of the votes secured by the
two parties should total up to 100%
i.e., x + x – 12 = 100
2x – 12 = 100
or 2x = 112 or x = 56%.
If Party D got 56% of the votes, then Party got (56 – 12) = 44% of the total votes.
44% of the total votes = 132,000 i.e. 44/100 * T = 132,000
T = (132000 * 100)/44 = 300000 votes.
The margin by which Party R lost the election = 12% of the total votes
= 12% of 300000 = 36000.
Workspace
Wipro TCS NQT
332. The G.C.D. of 1.08, 0.36 and 0.9 is:
Answer: 0.18
Explanation:Given numbers are 1.08 , 0.36 and 0.90
H.C.F of 108, 36 and 90 is 18 ( G.C.D is nothing but H.C.F)
So H.C.F of given numbers = 0.18
Workspace
Nagarro HCL Technologies Accenture Wipro
333. Structure can be used
Answer: All the above
Explanation:Here is no explanation for this answer
Workspace
Nagarro TCS Wipro
334. In which of the following cases dynamic arrays are not preferred?
Answer:
Explanation:Dynamic arrays are preferred when the size of the array is unknown during memory allocation or the size changes after few iterations or the memory reallocation is expensive. If array holds less number of elements, the physical size is reduced and reduction takes more time. In that case, we can use normal arrays instead of dynamic arrays.
Workspace
Wipro
335. I. public void store(int row_index, int col_index, Object val)
{
if (row_index < 0 && row_index > N)
{
System.out.println("column index out of bounds");
return;
}
if (col_index < 0 && col+index > N)
{
System.out.println("row index out of bounds");
return;
}
sparse_array[row_index].store(col_index, val);
}
II. public void store(int row_index, int col_index, Object val)
{
if (row_index < 0 || row_index > N)
{
System.out.println("row index out of bounds");
return;
}
if (col_index < 0 || col+index > N)
{
System.out.println("column index out of bounds");
return;
}
sparse_array[row_index].store(col_index, val);
}
III. public void store(int row_index, int col_index, Object val)
{
if (row_index < 0 || row_index > N)
{
System.out.println("column index out of bounds");
return;
}
if (col_index < 0 || col+index > N)
{
System.out.println("row index out of bounds");
return;
}
sparse_array[row_index].store(col_index, val);
}
IV. public void store(int row_index, int col_index, Object val)
{
if (row_index < 0 && row_index > N)
{
System.out.println("row index out of bounds");
return;
}
if (col_index < 0 && col+index > N)
{
System.out.println("column index out of bounds");
return;
}
sparse_array[row_index].store(col_index, val);
}
Answer:
Explanation:Each row in a sparse matrix acts as a sparse array, hence this row with the specified col_index is the array and the specified position where the element is stored.
Workspace
Wipro
336. What is the time complexity of the code that uses self balancing BST for determining the number of inversions in an array?
Answer:
Explanation:When a self balancing BST like an AVL tree is used to calculate the number of inversions in an array then the time complexity is O(n log n) as AVL insert takes O(log n) time.
Workspace
Wipro
337. Which of the following is the predefined function for array reversal in javascript?
Answer:
Explanation:The predefined function for reversing an array is reverse() in javascript. It does not requires any argument.
Workspace
Wipro
338. #include
using namespace std;
int min(int x, int y)
{ return (x < y)? x: y; }
int func(int arr[], int n)
{
int *jump = new int[n];
int i, j;
if (n == 0 || arr[0] == 0)
return INT_MAX;
jump[0] = 0;
for (i = 1; i < n; i++)
{
jump[i] = INT_MAX;
for (j = 0; j < i; j++)
{
if (i <= j + arr[j] && jumps[j] != INT_MAX)
{
jump[i] = min(jump[i], jump[j] + 1);
break;
}
}
}
return jump[n-1];
}
int main()
{
int arr[] = {1, 3, 6, 1, 9,7};
int size = sizeof(arr)/sizeof(int);
cout<< func(arr,size);
return 0;
}
Answer:
Explanation:The given code finds the minimum number of steps required to reach the end of the array by using dynamic programming. So the output will be 3.
Workspace
Wipro
339. Reference bit is used for
Answer: Implementing NRU algorithm
Explanation:Here is no explanation for this answer
Workspace
Societe Generale Wipro
340. What profit percentage is obtained by selling an article at certain price if by selling at 2/3 of that price there is a loss of 16%?
Answer:
Explanation:Let a certain selling price = x
so, 2/3 of that price = 2x/3
in 16% loss, selling price 84 then buying price 100
selling price 1 then buying price 100/84
selling price 2x/3 then buying price = 100*2x/252 = 0.79365x
therefore, profit = x - 0.79365x = 0.20635x
required(%) = 0.20635x*100/0.79365x=26
Therefore, profit is 26%
Workspace
MindTree HCL Technologies Wipro