0 votes 0 votes how it will be solve plz someone help? Programming in C made-easy-booklet programming programming-in-c + – aaru14 asked Nov 28, 2017 • recategorized Mar 6, 2019 by ajaysoni1924 aaru14 369 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Ashwin Kulkarni commented Nov 28, 2017 reply Follow Share is it O(n2) ? here's my logic. For i =0 , while loop will run for n times. i=1, while loop n-1 times i=2, while loop n-2 times and so on... i= n-1, while loop 0 times. hence complexity will be n+n-1+n-2....0 n(n+1)/2 = O(n2) 0 votes 0 votes Shubhanshu commented Nov 28, 2017 reply Follow Share Yes its TC is O( n2) ). Becuase it has nothing to deal with elemets of array. 0 votes 0 votes Please log in or register to add a comment.