daily pastebin goal
68%
SHARE
TWEET

Untitled

a guest Mar 19th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public boolean insertar (int elemento) {
  2.  
  3.     boolean result = false;
  4.  
  5.     int inicio = 0;
  6.     int fin = elementos.length - 1;
  7.     int pos;
  8.  
  9.     if(elementos.length == size){
  10.         result = false;
  11.     }
  12.  
  13.  
  14.     while (inicio <= fin) {
  15.         pos = (elementos.length - 1) / 2;
  16.         if (elementos[pos]  == elemento) {
  17.             result = false;
  18.         } else if ( elementos[pos] > elemento ) {
  19.             fin = pos - 1;
  20.  
  21.         } else {
  22.             inicio = pos + 1;
  23.         }
  24.     }
  25.  
  26.     return result;
  27.  
  28. }
  29.      
  30. `List <String> miListaDePalabras = new ArrayList <String> ();
  31.     String [ ] miArrayDePalabras = {"Oso", "León", "Buey", "Guepardo"};
  32.     System.out.println ("Contenido inicial del ArrayList: " + miListaDePalabras);
  33.     miListaDePalabras = Arrays.asList (miArrayDePalabras);`
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top