Klasa reprezentująca listę dwukierunkową. Klasa umożliwia dodawanie, usuwanie oraz przeglądanie elementów w obu kierunkach (przód i tył).
More...
#include <doubly_linked_list.hpp>
|
void | insertItemAtFront (int value) |
|
void | insertItemAtEnd (int value) |
|
void | insertItemAtIndex (int index, int value) |
|
void | removeFirstItem () |
|
void | removeLastItem () |
|
void | removeItemFromIndex (int index) |
|
void | removeAllItems () |
|
void | displayAllItems () const |
|
void | displayAllItemsReversed () const |
|
void | displayNextItemFromIndex (int index) const |
|
void | displayPreviousItemFromIndex (int index) const |
|
| DoublyLinkedList () |
| Domyślny konstruktor listy dwukierunkowej. Inicjalizuje pustą listę.
|
|
| ~DoublyLinkedList () |
| Destruktor listy dwukierunkowej. Usuwa wszystkie węzły i zwalnia pamięć.
|
|
void | insertItemAtFront (int value) |
| Dodaje nowy element na początku listy.
|
|
void | insertItemAtEnd (int value) |
| Dodaje nowy element na końcu listy.
|
|
void | insertItemAtIndex (int index, int value) |
| Wstawia nowy element na podaną pozycję.
|
|
void | removeFirstItem () |
| Usuwa pierwszy element z listy.
|
|
void | removeLastItem () |
| Usuwa ostatni element z listy.
|
|
void | removeItemFromIndex (int index) |
| Usuwa element na podanym indeksie.
|
|
void | removeAllItems () |
| Usuwa wszystkie elementy z listy.
|
|
void | displayAllItems () const |
| Wyświetla zawartość listy w kolejności od pierwszego do ostatniego elementu.
|
|
void | displayAllItemsReversed () const |
| Wyświetla zawartość listy w odwrotnej kolejności (od ostatniego do pierwszego elementu).
|
|
void | displayNextItemFromIndex (int index) const |
| Wyświetla elementy listy, zaczynając od podanego indeksu, w kolejności do przodu.
|
|
void | displayPreviousItemFromIndex (int index) const |
| Wyświetla elementy listy, zaczynając od podanego indeksu, w kolejności do tyłu.
|
|
const int & | operator[] (int index) const |
| Przeciążenie operatora [] do dostępu do wartości na podanym indeksie.
|
|
|
std::ostream & | operator<< (std::ostream &stream, const DoublyLinkedList &list) |
| Przeciążenie operatora << do wyświetlania zawartości listy.
|
|
std::ostream & | operator<< (std::ostream &stream, const DoublyLinkedList::Node *node) |
| Przeciążenie operatora << do wyświetlania węzła.
|
|
Klasa reprezentująca listę dwukierunkową. Klasa umożliwia dodawanie, usuwanie oraz przeglądanie elementów w obu kierunkach (przód i tył).
◆ displayNextItemFromIndex()
void DoublyLinkedList::displayNextItemFromIndex |
( |
int | index | ) |
const |
Wyświetla elementy listy, zaczynając od podanego indeksu, w kolejności do przodu.
- Parameters
-
◆ displayPreviousItemFromIndex()
void DoublyLinkedList::displayPreviousItemFromIndex |
( |
int | index | ) |
const |
Wyświetla elementy listy, zaczynając od podanego indeksu, w kolejności do tyłu.
- Parameters
-
◆ insertItemAtEnd()
void DoublyLinkedList::insertItemAtEnd |
( |
int | value | ) |
|
Dodaje nowy element na końcu listy.
- Parameters
-
value | Wartość elementu do dodania. |
◆ insertItemAtFront()
void DoublyLinkedList::insertItemAtFront |
( |
int | value | ) |
|
Dodaje nowy element na początku listy.
- Parameters
-
value | Wartość elementu do dodania. |
◆ insertItemAtIndex()
void DoublyLinkedList::insertItemAtIndex |
( |
int | index, |
|
|
int | value ) |
Wstawia nowy element na podaną pozycję.
- Parameters
-
value | Wartość elementu do wstawienia. |
index | Indeks, na którym element ma zostać wstawiony. |
◆ operator[]()
const int & DoublyLinkedList::operator[] |
( |
int | index | ) |
const |
Przeciążenie operatora [] do dostępu do wartości na podanym indeksie.
- Parameters
-
index | Indeks elementu, do którego chcesz uzyskać dostęp. |
- Returns
- Stała referencja do wartości elementu na podanym indeksie.
◆ removeItemFromIndex()
void DoublyLinkedList::removeItemFromIndex |
( |
int | index | ) |
|
Usuwa element na podanym indeksie.
- Parameters
-
index | Pozycja elementu do usunięcia. |
◆ operator<< [1/2]
std::ostream & operator<< |
( |
std::ostream & | stream, |
|
|
const DoublyLinkedList & | list ) |
|
friend |
Przeciążenie operatora << do wyświetlania zawartości listy.
- Parameters
-
stream | Strumień wyjściowy. |
list | Lista do wyświetlenia. |
- Returns
- Referencja do strumienia wyjściowego.
◆ operator<< [2/2]
std::ostream & operator<< |
( |
std::ostream & | stream, |
|
|
const DoublyLinkedList::Node * | node ) |
|
friend |
Przeciążenie operatora << do wyświetlania węzła.
- Parameters
-
stream | Strumień wyjściowy. |
node | Wskaźnik na węzeł do wyświetlenia. |
- Returns
- Referencja do strumienia wyjściowego.
- Parameters
-
stream | Strumień wyjściowy. |
node | Wskaźnik na węzeł, który ma być wyświetlony. |
- Returns
- Referencja do strumienia wyjściowego.
The documentation for this class was generated from the following files:
- docs/kod/doubly_linked_list.cpp
- src/doubly_linked_list/doubly_linked_list.hpp
- src/doubly_linked_list/doubly_linked_list.cpp