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).
Answer:
The answers are: 220, 299, 4017, and 924.
Explanation:
a) (¹²₃) = 220
b( ¹²₀) + (¹²₁) + (¹²₂) +( ¹²₃) = 1 +12+66+220= 299.
c) 2¹² - 66-12-1 =4017
d) (¹²₆) = 924
You're taken to the home tab, where you can see all of the basic controls.
When creating a mood board or website, the recommended number of colors to use is: C. two or three main colors.
<h3>What is a Mood Board?</h3>
A mood board can be described as a visual presentation used by graphic designers to convey a general idea or feeling about a theme or topic. They may include images, samples of objects or text.
In graphic design, wen it comes to color combination, a general rule states that we keep the colors at two or three at most.
Therefore, when creating a mood board or website, the recommended number of colors to use is: C. two or three main colors.
Learn more about mood board on:
brainly.com/question/5759153