O5n is always smaller than On2 for any value of n 0 True Fa

O(5n) is always smaller than O(n^2) for any value of n > 0 True False Write a C++ program segment as an example, to demonstrate how a constructor function is defined and how it is used from the main program. The concept of function overloading is also known as polymorphism. True False

Solution


class Sample
{
int a;
public:
Sample(int x)
{
a=x;
}
  

};

int main()
{
  
int a=5;
  
Sample obj(a);
  
return 0;
}

 O(5n) is always smaller than O(n^2) for any value of n > 0 True False Write a C++ program segment as an example, to demonstrate how a constructor function i

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site