#include <memory>
#include <iostream>
#include <string>
#include <sstream>
#include <ostream>
template< typename TIPONODO >
void NodoLista< TIPONODO >::pop(){
if (this->siguientePtr != 0 ){
NodoLista< TIPONODO > *sgPtr;
sgPtr=this->siguientePtr->siguientePtr;
this->datos=this->siguientePtr->datos;
this->siguientePtr = sgPtr;
}
if (this->siguientePtr == 0){
this->datos = 0;
}
}
template< typename TIPONODO >
void NodoLista<TIPONODO>::push(const TIPONODO& o){
TIPONODO x=this->datos;
NodoLista<TIPONODO> n1(o);
NodoLista<TIPONODO> n2(x);
if( this->datos < o ){
this->datos=o;
n2.siguientePtr = this->siguientePtr;
this->siguientePtr = &n2;
}
else{
}
}
template< typename TIPONODO >
const TIPONODO& NodoLista< TIPONODO >::top() const {
/*const TIPONODO& ret = &datos;
return *ret;*/
}
#endif
//I can't push the elements the right way, it just seems to be pushing two elements at a time when they have more priority. Need help.
Last edited on