irm christitus.com/win | iex
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
| # ~/.config/starship.toml | |
| add_newline = false | |
| command_timeout = 1000 | |
| format = """$os$username$hostname$kubernetes$directory$git_branch$git_status""" | |
| # Drop ugly default prompt characters | |
| [character] | |
| success_symbol = '' | |
| error_symbol = '' |
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
| // Ejercicio 4: | |
| // Insertar el elemento K antes del penúltimo elemento | |
| // C(8,3,7,6,5,9) K = 100 => C(8,3,7,6,100,5,9) | |
| import java.util.Scanner; | |
| import java.util.Queue; | |
| import java.util.LinkedList; | |
| public class nombreCreativo { | |
| public static void main(String[] args) throws Exception { |
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
| // Ejercicio 3: Duplicar el elemento "K" en una cola | |
| import java.util.Scanner; | |
| import java.util.Queue; | |
| import java.util.LinkedList; | |
| public class Sape { | |
| public static void main(String[] args) throws Exception { | |
| Scanner sc = new Scanner(System.in); | |
| Queue<Integer> cola = new LinkedList<Integer>(); | |
| System.out.println("Ingrese los elementos: "); |
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
| // Ejercicio 2 | |
| // Obtener el tercer elemento de una cola | |
| // C(6,4,2,12,7,3) => 2 | |
| import java.util.Scanner; | |
| import java.util.Queue; | |
| import java.util.LinkedList; | |
| //usar solo while :,v | |
| public class Main { |
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
| // Ejercicio 1: | |
| // Sumar elementos impares divisibles entre 3 | C(11,6,3,4,15,2) => sum = 3 + 15 = 18 | |
| // Hacerlo con colas | |
| import java.util.Scanner; | |
| import java.util.Queue; | |
| import java.util.LinkedList; | |
| //solo usar while y no for | |
| public class App { |
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
| // Ejercicio 3 :,v | |
| import java.util.Stack; | |
| import java.util.Scanner; | |
| public class Ejercicio3 { | |
| public static void main(String[] args) { | |
| Stack<Integer> pilaA = new Stack<>(); | |
| Stack<Integer> pilaB = new Stack<>(); |
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.Scanner; | |
| import java.util.Stack; | |
| public class Ejercicio2 { | |
| // | |
| // Llenar la pila P y verificar si es capicúa. | |
| // Capicúa: Si los elementos almacenados de izquierda a derecha se leen de la | |
| // misma | |
| // forma que de derecha a izquierda. | |
| // P (3, 6, 2, 5, 7) => “No es capicúa” |
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.Scanner; | |
| import java.util.Stack; | |
| public class Ejercicio1 { | |
| public static void main(String[] args) { | |
| Scanner numero = new Scanner(System.in); | |
| Stack<Integer> pilaA = new Stack<>(); | |
| Stack<Integer> pilaB = new Stack<>(); | |
| Stack<Integer> pilaC = new Stack<>(); |
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
| // 2. Llenar una cola con números y obtener la cola A con capicuas mayores a 10. | |
| import java.util.Scanner; | |
| import java.util.Queue; | |
| import java.util.LinkedList; | |
| public class Main { | |
| public static void main(String[] args) throws Exception { | |
| Scanner sc = new Scanner(System.in); | |
| Queue<Integer> cola = new LinkedList<>(); |