commit 6c8e3a93ebc52ed79f805bca12f39d9aba583c9a
parent 65587c25570c3586b6835b7dd9ae61df13258075
Author: CamiAni <129856337+CamiAni@users.noreply.github.com>
Date: Sun, 23 Jun 2024 19:45:17 -0300
Update list.h
Remove fuctions: "remove","obtenerNodo", "validarPosicion"
Diffstat:
| M | list.h | | | 47 | ----------------------------------------------- |
1 file changed, 0 insertions(+), 47 deletions(-)
diff --git a/list.h b/list.h
@@ -61,16 +61,6 @@ public:
* pos: devuelve el dato del nodo en el cual se encuentra el cursor
*/
Type getCursorData();
-
- void validarPosicion(unsigned int posicion);
-
- Node<Type> *obtenerNodo(unsigned int posicion);
-
- /*
- *pre : posición pertenece al intervalo: [1, contarElementos()]
- *pre * post: remueve de la Lista el elemento en la posición indicada.
- */
- void remove(unsigned int posicion);
};
template <typename Type>
@@ -129,41 +119,4 @@ template<class Type>
Type List<Type>::getCursorData() {
return this->cursor->getData();
}
-
-
-template <typename Type> void List<Type>::validarPosicion(unsigned int posicion) {
- if ((posicion < 1) ||
- (posicion > this->size + 1)) {
- throw "La posicion debe estar entre 1 y tamaño + 1";
- }
-}
-
-template <typename Type>
-Node<Type> *List<Type>::obtenerNodo(unsigned int posicion) {
- //validarPosicion(posicion);
- Node<Type> * actual = this->first;
- for(unsigned int i = 1; i < posicion; i++) {
- actual = actual->getNext();
- }
- return actual;
-}
-
-template <typename Type>
-void List<Type>::remove(unsigned int posicion) {
- validarPosicion(posicion);
- Node<Type> *removido;
-
- if (posicion == 1) {
- removido = this->first;
- this->first = removido->getNext();
- } else {
- Node<Type> *anterior = this->obtenerNodo(posicion - 1);
- removido = anterior->getNext();
- anterior->setNext( removido->getNext());
- }
-
- delete removido;
- this->size--;
-}
-
#endif /* LIST_H_ */