Skip to content

Commit

Permalink
feef
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcosRguez committed Jun 20, 2022
1 parent 859a3f0 commit 0dd8787
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 28 deletions.
22 changes: 12 additions & 10 deletions clase_lista_enlazada.hh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
*/
template <typename T>
class Lista_SE {
public:
public:
/// Constructores
Lista_SE() : head_{nullptr} {} /// Constructor por defecto
Lista_SE() :
head_{nullptr} {} /// Constructor por defecto
Lista_SE(const T& data) {
head_ = new Nodo_SE<T>;
head_->data(data);
} /// Constructor estándar
} /// Constructor estándar
// ListaEnlazada(); /// Constructor copia
/// Destructores
~Lista_SE() { head_ = nullptr; }
Expand Down Expand Up @@ -85,8 +86,8 @@ class Lista_SE {
/// Getters
const Nodo_SE<T>& head() const { return *head_; }
/// Setters
protected:
private:
protected:
private:
/// Atributos
Nodo_SE<T>* head_;
};
Expand All @@ -97,14 +98,15 @@ class Lista_SE {
*/
template <typename T>
class Lista_DE {
public:
public:
/// Constructores
Lista_DE() : head_{nullptr} {} /// Constructor por defecto
Lista_DE() :
head_{nullptr} {} /// Constructor por defecto
Lista_DE(const T& data) {
head_ = new Nodo_DE<T>;
head_->data(data);
tail_ = *head_;
} /// Constructor estándar
} /// Constructor estándar
// ListaEnlazada(); /// Constructor copia
/// Destructores
~Lista_DE() {
Expand Down Expand Up @@ -153,8 +155,8 @@ class Lista_DE {
const Nodo_DE<T>& head() const { return *head_; }
const Nodo_DE<T>& tail() const { return *tail_; }
/// Setters
protected:
private:
protected:
private:
/// Atributos
Nodo_DE<T>* head_;
Nodo_DE<T>* tail_;
Expand Down
42 changes: 24 additions & 18 deletions clase_nodo.hh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
*/
template <typename T>
class Nodo_SE {
public:
/// Constructores
Nodo_SE() : next_{nullptr}, data_{} {} /// Constructor por defecto
Nodo_SE(Nodo_SE<T>* const ptr, const T& data)
: next_{ptr}, data_{data} {} /// Constructor estándar
Nodo_SE(const Nodo_SE<T>& copia) { this = copia; } /// Constructor copia
public:
/// Constructores
Nodo_SE() :
next_{nullptr},
data_{} {} /// Constructor por defecto
Nodo_SE(Nodo_SE<T>* const ptr, const T& data) :
next_{ptr},
data_{data} {} /// Constructor estándar
Nodo_SE(const Nodo_SE<T>& copia) { this = copia; } /// Constructor copia
/// Destructores
~Nodo_SE() { next_ = nullptr; }
/// Métodos
Expand All @@ -27,9 +30,9 @@ class Nodo_SE {
Nodo_SE<T>*& next() { return next_; }
T& data() { return data_; }

protected:
private:
/// Atributos
protected:
private:
/// Atributos
Nodo_SE<T>* next_;
T data_;
};
Expand All @@ -40,12 +43,15 @@ class Nodo_SE {
*/
template <typename T>
class Nodo_DE {
public:
/// Constructores
Nodo_DE() : next_{nullptr}, data_{} {} /// Constructor por defecto
Nodo_DE(Nodo_DE<T>* const ptr, const T& data)
: next_{ptr}, data_{data} {} /// Constructor estándar
Nodo_DE(const Nodo_DE<T>& copia) { this = copia; } /// Constructor copia
public:
/// Constructores
Nodo_DE() :
next_{nullptr},
data_{} {} /// Constructor por defecto
Nodo_DE(Nodo_DE<T>* const ptr, const T& data) :
next_{ptr},
data_{data} {} /// Constructor estándar
Nodo_DE(const Nodo_DE<T>& copia) { this = copia; } /// Constructor copia
/// Destructores
~Nodo_DE() {
next_ = nullptr;
Expand All @@ -67,9 +73,9 @@ class Nodo_DE {
Nodo_DE<T>*& prev() { return prev_; }
T& data() { return data_; }

protected:
private:
/// Atributos
protected:
private:
/// Atributos
Nodo_DE<T>* next_;
Nodo_DE<T>* prev_;
T data_;
Expand Down

0 comments on commit 0dd8787

Please sign in to comment.