0 votes 0 votes For (i=1;i<n2;i++). a[i]=i; Algorithms algorithms time-complexity + – Simran Singh asked Aug 13, 2017 retagged Jun 21, 2022 by makhdoom ghaya Simran Singh 478 views answer comment Share Follow See 1 comment See all 1 1 comment reply joshi_nitish commented Aug 13, 2017 reply Follow Share O(n2) loop is simply running from 1 to n2 i.e n2 times.. 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes Analysis: i=1 2 3 4 .......n iteration=1 4 9 16.......k2 sequence is in the form of sum of squares of natural numbers so time complexity t(n)=O(n2). G Shaheena answered Aug 13, 2017 G Shaheena comment Share Follow See all 0 reply Please log in or register to add a comment.