forked from EddyVegaGarcia/TP-n-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlistaCircularCursor.h
50 lines (32 loc) · 1.04 KB
/
listaCircularCursor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef LISTACIRCULARCURSOR_H_
#define LISTACIRCULARCURSOR_H_
#include "nodo.h"
template<class T> class ListaCircularCursor{
private:
Nodo<T>* cursor;
Nodo<T>* primero;
unsigned int tamanio;
public:
//constructor, se crea vacia
ListaCircularCursor();
//pre:
//post: inserta un elemento en la posicion (this->tamanio)
void insertar(T elementoNuevo)
//pre:
//post: si la lista no tiene nodos, se inserta como primer elemento,
// si tiene mas de uno, se luego del ultimo ingresado.
void insertar(T elementoNuevo, unsigned int posicion);
//pre: tiene que existir un elemento en la lista
// posicion <= this-> tamanio
//post: remueve el elemento de la lista
void remover(unsigned int posicion);
//pre: debe haber al menos un elemento en la lista
//post: deja el cursor apuntando al primer elemento
void inicializarCursor();
//post: apunta el cursor al siguiente elemento
// en caso de no estar inicializado, lo inicializa.
void avanzarCursor();
T obtenerCursor();
bool estaVacia();
};
#endif /* LISTACIRCULARCURSOR_H_ */