This file contains hidden or 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
| import java.util.Arrays; | |
| public class bubble { | |
| public static void main (String args[]) { | |
| int[] n = {900, 5, 9, 4, 3, 7, 13, 5, 1, 80, 90, 40, 60, 10, -54, 10, 2, -9090}; | |
| System.out.println(Arrays.toString(n)); | |
| System.out.println(Arrays.toString(bubble(n))); | |
| } | |
| public static int[] bubble (int n[]) { | |
| int tmp, l = n.length; |
This file contains hidden or 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 bubble () { | |
| int[] n = {5, 9, 4, 3, 7, 13, 5, 1}; | |
| System.out.println(Arrays.toString(n)); | |
| int l = n.length; | |
| int f = l-1; | |
| int tmp = 0; | |
| for (int i=l;i>0;i--) { | |
| for (int x=0;x<f;x++) { | |
| if (n[x] > n[x+1]) { | |
| tmp = n[x]; |
This file contains hidden or 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
| c=("\e[38;5;9m" "\e[38;5;10m" "\e[38;5;11m" "\e[38;5;13m" "\e[38;5;14m") | |
| while true; do | |
| for((x=0; x < 5; x++)); do | |
| echo -e "${c[x]}" | |
| for((i=0; i < 80; i++ )); do | |
| for((j=0; j < 80; j++ )); do | |
| echo -n "e" | |
| done | |
| echo "" |
NewerOlder