Answer:
Algorithm:
for (i = 0; i < n; i++)
L[i][i] = 1;
for (cl=2; cl<=n; cl++)
{
for (i=0; i<n-cl+1; i++)
{
j = i+cl-1;
if (str[i] == str[j] && cl == 2)
L[i][j] = 2;
else if (str[i] == str[j])
L[i][j] = L[i+1][j-1] + 2;
else
L[i][j] = max(L[i][j-1], L[i+1][j]);
}
}
Time complexity:
O(n^2)
Explanation:
- Run a for loop until i is less than n and assign a value of 1 to the L 2D array which is of size n*n while n being the length of the string.
- Run a nested for loop and check if the value at ith and jth index of str input string is equal, and then assign the value of 2 to the L 2D array.
- Otherwise choose the maximum value from within the 2D array using the max function.
- As there is a nested loop used in this algorithm so the time complexity of the algorithm is O(n^2).
I think it would be the fourth answer choice.
Answer:
The correct answer is $32.30
Explanation:
1 million shares sold at $35 per share equals to $35 million. $2.45 spread per share for 1 million is equal to $2.45 million and the firm also paid the $250,000 for other costs. With the spread added, that makes $2.7 million. If you subtract that from the total sales of $35 million, you get $32.3 million, so the firm's net proceedings come up to $32.30 per share for a million shares.
I hope this answer helps.
No more than six lines, and no more than six words in a 6 by 6 rule.