Answer:
Check the explanation
Explanation:
1) f(n) = O( 1 ), since the loops runs a constant number of times independent of any input size
there is no critical section in the code, as a critical section is some part of code which is shared by multiple threads or even processes to modify any shared variable.This code does not contain any variable which can be shared.
2) f(n) = O( log n! ), the outer loop runs for n times, and the inner loop runs log k times when i = k,ie the total number of print will be – log 1 + log2 +log3 +log4+…...+ log n = log (1 . 2 . 3 . 4 . ……. . n ) =log n!
there is no critical section in the code, as a critical section is some part of code which is shared by multiple threads or even processes to modify any shared variable.This code does not contain any variable which can be shared.
Note : Log (m *n) = Log m + Log n : this is property of logarithm
3) f(n) = , since both outer and inner loop runs n times hence , the total iterations of print statement will be : n +n+n+…+n
for n times, this makes the complexity – n * n = n2
there is no critical section in the code, as a critical section is some part of code which is shared by multiple threads or even processes to modify any shared variable.This code does not contain any variable which can be shared.
def is_list_even(my_list):
for i in my_list:
if(i%2 != 0):
return False
return True
def is_list_odd(my_list):
for i in my_list:
if(i%2 == 0):
return False
return True
def main():
n = int(input())
lst = []
for i in range(n):
lst.append(int(input()))
if(is_list_even(lst)):
print('all even')
elif(is_list_odd(lst)):
print('all odd')
else:
print('not even or odd')
if __name__ == '__main__':
main()
False. Expressing your needs to others is basically just saying what you need and what you want but you are not being aggressive unless you are hurting the person (physically or verbally) to get what you want.
Answer:
I had long thought about it, but I could never justify investing in a desktop PC. I feared it would mostly end up sitting idle at my desk, as its value and performance continue to depreciate. “I’m better off buying a beefy laptop,” I kept telling myself. But I was wrong all along.

It’s been a little over a month since I gathered the courage to put together a rig, and I couldn’t be happier about my choice. It’s not only been a pleasure to use it for work, but it’s also rekindled my love for gaming, which has been a refreshing addition to my daily routine.
As fun as it was to assemble my very first PC, there were quite a few things that went wrong in the process. In this piece, I wanted to share some of those hiccups, and also offer some tips on how to avoid them.
To be clear, this isn’t an all-encompassing instructable on how to build a PC — it’s merely a few tips on how to approach the process. You’ll still have to do most of the legwork yourself.