AlgoPlus v0.1.0
Loading...
Searching...
No Matches
circular_linked_list< T > Class Template Reference

circular linked list class More...

#include <circular_linked_list.h>

Classes

class  Iterator
 Iterator class. More...
 

Public Member Functions

 circular_linked_list (std::vector< T > _elements={}) noexcept
 Construct a new circular linked list object.
 
 circular_linked_list (const circular_linked_list &c)
 copy constructor for the circular linked list class
 
circular_linked_listoperator= (const circular_linked_list &c)
 operator = for circular linked list class
 
bool empty ()
 empty function
 
size_t size ()
 size function
 
Iterator begin ()
 pointer that points to begin
 
Iterator end ()
 pointer that points to end
 
void push_back (T key)
 push_back function
 
void push_front (T key)
 push_front function
 
void erase (T key)
 erase function
 
bool search (T key)
 search function
 
std::vector< T > elements ()
 elements function
 
void visualize ()
 visualize function returns a .dot file that can be previewd with graphviz plugin in vscode
 

Friends

std::ostream & operator<< (std::ostream &out, circular_linked_list< T > &l1)
 << operator for the circular list class
 

Detailed Description

template<typename T>
class circular_linked_list< T >

circular linked list class

Constructor & Destructor Documentation

◆ circular_linked_list() [1/2]

template<typename T>
circular_linked_list< T >::circular_linked_list ( std::vector< T > _elements = {})
inlineexplicitnoexcept

Construct a new circular linked list object.

Parameters
__elementsvector<T> so you dont have to do multiple insertions

◆ circular_linked_list() [2/2]

template<typename T>
circular_linked_list< T >::circular_linked_list ( const circular_linked_list< T > & c)
inlineexplicit

copy constructor for the circular linked list class

Parameters
cthe list we want to copy

Member Function Documentation

◆ begin()

template<typename T>
Iterator circular_linked_list< T >::begin ( )
inline

pointer that points to begin

Returns
Iterator

◆ elements()

template<typename T>
std::vector< T > circular_linked_list< T >::elements ( )
inline

elements function

Returns
std::vector<T> the elements of the list

◆ empty()

template<typename T>
bool circular_linked_list< T >::empty ( )
inline

empty function

Returns
true if the list is empty
false otherwise

◆ end()

template<typename T>
Iterator circular_linked_list< T >::end ( )
inline

pointer that points to end

Returns
Iterator

◆ erase()

template<typename T>
void circular_linked_list< T >::erase ( T key)
inline

erase function

Parameters
keythe key to be erased

◆ operator=()

template<typename T>
circular_linked_list & circular_linked_list< T >::operator= ( const circular_linked_list< T > & c)
inline

operator = for circular linked list class

Parameters
cthe list we want to copy
Returns
circular_linked_list&

◆ push_back()

template<typename T>
void circular_linked_list< T >::push_back ( T key)
inline

push_back function

Parameters
keythe key to be inserted

◆ push_front()

template<typename T>
void circular_linked_list< T >::push_front ( T key)
inline

push_front function

Parameters
keythe key to be inserted

◆ search()

template<typename T>
bool circular_linked_list< T >::search ( T key)
inline

search function

Parameters
keythe key to be searched
Returns
true if the key exist in the list
false otherwise

◆ size()

template<typename T>
size_t circular_linked_list< T >::size ( )
inline

size function

Returns
size_t the size of the list

The documentation for this class was generated from the following file: