Answer:
The computer can do 12000 searches per second. Suppose there are 60000 inventory items. And we need to search one item from it in a sequential manner. The computer can do 12000 searches in one second. Hence it can search in a list of 60000 inventory in 5 seconds, as 12000 x 5 =60000 searches, in the worst case. And if the item is below 12000 on the list, it will take less than 1 second(1/12000 sec in best case), and so on.
And if we assume that the list is sorted, and perform a binary search. then in the worst case, the number of searches required in the worst case will be 60000/2= 30000. And the time required will be 30000/12000= 5/2=2.5 seconds, and (1/24000) seconds in the best case. Its 1/24000 as its binary search.
Explanation:
Please check the answer section.
Here you go,
class Program
{
static void Main(string[] args)
{
int n,i,j;
Console.Write("Enter size: ");
n = Convert.ToInt32(Console.ReadLine());
for (i = 1; i <= n; i++)
{
for (j = 1; j <= i; j++)
{
System.Console.Write("*");
}
System.Console.Write("\n");
}
Console.ReadLine();
}
}
Answer:
Check explanation
Explanation:
Well, for one thing, C++ is a superset of C. This means:
- They both have similar syntax
- Similar code structure
- Similar compilation
Another similarity is that pretty much all of C's keywords and operators are used in C++ with the same use.
They both also use the semicolon (;) as the statement terminator.
There you go. 5 similarities between C and C++.
It should be under lined, when you press it it should have a different colour