Answer:
I. Algorithms can be written using pseudocode.
II. Algorithms can be visualized using flowcharts.
Explanation:
An algorithm can be defined as a standard formula or procedures which comprises of set of finite steps or instructions for solving a problem on a computer. The time complexity is a measure of the amount of time required by an algorithm to run till its completion of the task with respect to the length of the input.
The two statements which are true about algorithms are;
I. Algorithms can be written using pseudocode. A pseudocode refers to the description of the steps contained in an algorithm using a plain or natural language.
II. Algorithms can be visualized using flowcharts. A flowchart can be defined as a graphical representation of an algorithm for a process or workflow.
Basically, a flowchart make use of standard symbols such as arrows, rectangle, diamond and an oval to graphically represent the steps associated with a system, process or workflow sequentially i.e from the beginning (start) to the end (finish).
Answer:
void print2(int row) {
for (int i = 0; i < row; i++) {
char ch = 'a';
char print = ch;
for (int j = 0; j <= i; j++) {
cout << print++;
}
cout << endl;
}
}
int count_digits(int num) {
int count = 0;
int temp = num;
while (temp != 0) {
temp = temp / 10;
count++;
}
return (num % count);
}
Explanation:
left[0]=a[0];
for(int i=1;i<=n-1;i++)
left[i]=(left[i-1]*a[i])%M;
right[n-1]=a[n-1];
for(int i=n-2;i>=0;i--)
right[i]=(right[i-1]*a[i])%M;
for query q
if(q==0)
return right[1]%M;
if(q==n-1)
return left[n-2]%M;
return (left[q-1]*right[q+1])%M;
Jennifer Lopez’s picture led to the creation of google images.
Equal sign (=)
hope so !!!