Last active
September 25, 2022 23:05
-
-
Save Vaib215/d01f22a0da7059e0e2e27fe3602260ab to your computer and use it in GitHub Desktop.
TC - O(N^3)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void printSubArr(int a[]){ | |
int n = a.length; | |
for (int i = 0; i < n; i++) { | |
for (int j = i; j < n; j++) { | |
System.out.print("["); | |
for (int k = i; k <= j; k++) { | |
System.out.print(a[k]+","); | |
} | |
System.out.print("], "); | |
} | |
System.out.println(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment