Answer:
p(x,n)
1. if(n==0) [if power is 0]
2. then result =1.
3.else
4. { result=1.
5. for i=1 to n.
6. { result = result * x. } [each time we multiply x once]
7. return result.
8. }
Let's count p(3,3)
3
0, so come to else part.
i=1: result = result *3 = 3
i=2: result = result *3 = 9
i=2: result = result *3 = 27
Explanation:
here the for loop at step 4 takes O(n) time and other steps take constant time. So overall time complexity = O(n)
It is a programmer's responsibility to contribute to society and human well-being is true.
Explanation:
- It is a programmer's responsibility to contribute to society and human well-being is true.
- The Association for Computing Machinery (ACM) is known as the world's largest educational and scientific computing society.
- It has its own Code of Ethics and another set of ethical principles which were also approved by the IEEE as the known standards of teaching and practicing software engineering.
- Programmers contribute to develop computer systems which can reduce negative impression to the society.
- The negativity includes as threats to safety and health, which can be reduced and make everyday activities and work easier.
- software developers should reduce the risk of harming others due to the coding errors or the security issues which could impact human well-being.
These principles are not explicit to one kind of program and are increasingly broad "best practice" rules that assist designers with composing code that is easier to maintain.
<u>Explanation:</u>
A set of programming guidelines that are executed to play out a particular undertaking according to the prerequisites of the client is known as programming. Every product has some essential standards to follow. In light of all product frameworks have basic quality traits, including accessibility, modifiability, execution, security and wellbeing, testability and ease of use, the key programming thoughts give basic arrangements or strategies to help those characteristics.
It is generally less expensive, over the long haul, to utilize programming designing strategies and methods for programming frameworks instead of simply compose the projects as though it was an individual programming venture.
Answer:
that is technical but I will go with all I mean d