Is mybcode satisfies below condition? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is mybcode satisfies below condition?

I am having doubt about complexities of below code? Is the below code has space complexity =O(n) and time Conplexity =O(1).pls answer me what is time and space complexity of code below. And i don't have clear idea of how to find complexities of algorithm. Pls suggest any video tutorial or any book reference to me. https://code.sololearn.com/cY06ASinYCbY/?ref=app

17th Jun 2021, 4:34 PM
Jawahirullah
Jawahirullah - avatar
1 Answer
0
both are O(n) because if you process array of n * 10 length it takes n * 10 more operations in time and takes n *10 more spaces in memory.
21st Jun 2021, 10:48 PM
zemiak