Nested for loop Pattern problems sum of a pair whose sum is equal to k ============================================= What is time complexity : Manish : The Time taken by computer to execute the program is called time complexity I wrote a program of length 500 lines windows 8 gb i5 - 20 micro seconds windows 16gb i7 - 10 micro seconds Apple - 5 mili seconds super computer - 1 milli second Actual Defnition the rate at which time increase wrt to inputs it is time complexity 0=dy/dx= dt/dinput =this rate is constant across all the machines for(int i=0;i 15+1= 16 steps == 0(16)=0(5*3+1) = 0(n*3+1)= 0(3n+1)~0(n) computer scients measure time complexity in 3 ways 1 lakh + 1rupee ~ 1 lakh big 0 notation omega (X) theata (X) =================== distance - meters liquid - liters 1 liter ~ 1 km ==================== ANSI - that measurement ====================== 3 considerations for time complexity 1. always consider worst case time complexity 2. Avoid constants 3 . Avoid lower values name=sc.next(); name= "Virat" if(name == "Santosh") sop("Hi I am Santosh" else if(name == "Vineerth) sop("Hi I am Vineeth" else if(name == "Manish") sop("Hi I am Manish") else sop("else user not found"); best time complexity is 0(2) worst time complexity 0(8) for(int i=0;i