00001 00006 #ifndef _conjunto_reales_h 00007 #define _conjunto_reales_h 00008 00009 #include <vector_dinamico.h> 00010 #include <cassert> 00011 00030 class Conjunto_Reales { 00031 private: 00050 Vector_Dinamico v; 00051 int nelementos; 00061 bool posicion_elemento(int& pos, float val) const; 00062 public: 00063 Conjunto_Reales(): nelementos(0) {} 00064 // Conjunto_Reales(const Conjunto_Reales& c); 00065 // ~Conjunto_Reales(); 00066 // Conjunto_Reales& operator= (const Conjunto_Reales& c); 00074 bool insertar(float f); 00082 bool borrar(float f); 00089 bool pertenece(float f) const { int pos; return posicion_elemento(pos,f); } 00097 float elemento(int i) const { assert(0<=i && i<v.size()); return v[i]; } 00102 int size() const { return nelementos; } 00103 }; 00104 00105 #endif /* _conjunto_reales_h */