added TC and SC of code

pull/1221/head
Aryan 2023-07-08 12:24:12 +05:30
parent eb307abe99
commit c0e29c9af3
1 changed files with 3 additions and 0 deletions

View File

@ -23,6 +23,9 @@ Proof -
and hence we shift to the element to immediate right and do the same process .
*/
// TIme Complexity of Code - O (n ^2 ) since outer loop -> n times and inner loop (worst case ) -> n times so TC = n * n
// Space Complexity of Code - O (1) since does not use any auxillary space
// Implementation
#include <bits/stdc++.h>