Since you gave kind of a vague question. I'll just go with the basics. Amortized analysis in computer science is basically the study of worst case run times regarding a sequence of operations.
When looking at potential, it is the physicist's method.
phi (initial state) =0 and every state after is larger than 0.
It keeps track of time but relies on states to know where it is.
The equation C +phi (state')-phi(state) is the main equation. C is the time for an operation, "state" is before and "state'" is after.
There are sets of equations that dictate average run time with this.
ex.
phi (H)= 2n-m. n=number of elements, m=size of array.
This equation is used to calculate the time to double the size.
Answer:
#include <stdio.h>
void main()
{
int num;
printf("Input a number :");
scanf("%d", &num);
if (num >= 0)
printf("%d is a positive number \n", num);
else
printf("%d is a negative number \n", num);
}
Explanation:
good luck.
hope it helped you.
pls mark brainleist
Answer:
Since the question expect us to declare a C-string, the solution code is written in C as follows:
- char ssn[9];
- scanf("%s",ssn);
Explanation:
A C-String is a string written in C language. It is an array of characters. To declare a C-string, we use the keyword, <em>char </em>and then followed with the variable name + brackets and the number of characters in the string. For example, we can create a C-String for the SSN number as in Line 1.
To read standard input into the array, we can use C built-in function, <em>scanf(). </em>Just include a string placeholder, %s, and the variable<em> ssn </em>as arguments to <em>scanf()</em>. This will assign the string input by user to variable <em>ssn</em> as C-String.