Archive for September, 2007

25th Sep 2007

Metodos numericos

Por ahora, solo pongo dos métodos, el de bisección y el método de la regla falsa



http://util.inocorp.org/numericmethod/

Posted in codigos, proyectos terminados | No Comments »

13th Sep 2007

Pila en javascript

JAVASCRIPT:
  1. //creando la clase pila
  2.       var Stack = function(size){
  3.           this.Size=size;
  4.           this.Stacker = new Array(size);
  5.           this.pointer=0;
  6.  
  7.           //funciones
  8.  
  9.           //inserta a la pila
  10.           this.Push = function(cadena){
  11.               if(this.IsFull()==false){
  12.                   this.Stacker[this.pointer]=cadena;
  13.                   this.pointer++;
  14.                   return true;
  15.               }
  16.               else{
  17.                   return false;
  18.               }
  19.           }
  20.  
  21.  
  22.           //saca de la pila
  23.           this.Pop = function(){
  24.               if(this.IsEmpty!=true){
  25.                   this.pointer--;
  26.                   return this.Stacker[this.pointer];
  27.               }
  28.               else{
  29.                   return false;
  30.               }
  31.           }
  32.  
  33.           //esta vacia?
  34.           this.IsEmpty = function(){
  35.               if(this.pointer==0) return true;
  36.               else return false;
  37.           }
  38.  
  39.           //esta llena?
  40.           this.IsFull = function(){
  41.               if(this.pointer==this.Size) return true;
  42.               else return false;
  43.           }
  44.       }

Posted in codigos | 2 Comments »