Brumski's DSA Learning Project 1.3
For Learning Data Structures and Algorithms in C++
Loading...
Searching...
No Matches
LinkedList< LLType > Class Template Reference

This is a template class that represents the linked list. More...

#include <linkedlist.hpp>

Classes

class  Node
 This is a template class represents a single element of the linked list, and it will be called "Node". More...
 

Public Member Functions

 LinkedList ()=default
 Default Constructor.
 
 LinkedList (const LinkedList< LLType > &)=delete
 Deleted copy constructor.
 
 LinkedList (LinkedList< LLType > &&other) noexcept=default
 Default Move constructor.
 
virtual LinkedList< LLType > & operator= (const LinkedList< LLType > &)=delete
 Default Copy assignment operator Prevents assigning the values of existing LinkedList<T> objects to other objects.
 
virtual LinkedList< LLType > & operator= (LinkedList< LLType > &&other) noexcept=default
 Move assignment operator.
 
virtual ~LinkedList ()=default
 Default Destructor.
 
virtual LinkedListinsertAtFront (const LLType &value)
 Inserts a value at the front of the linked list.
 
virtual LinkedListinsertAtEnd (const LLType &value)
 Inserts a value at the end of the linked list.
 

Friends

std::ostream & operator<< (std::ostream &os, const LinkedList< LLType > &obj)
 Outputs the values in the linked list.
 

Detailed Description

template<class LLType>
class LinkedList< LLType >

This is a template class that represents the linked list.

It can take any basic C++ data type. A linked list is a linear data structure, it can store multiple elements of the same data type. Each node in a linked list contains the data item and a pointer to the next node.

Constructor & Destructor Documentation

◆ LinkedList()

template<class LLType >
LinkedList< LLType >::LinkedList ( LinkedList< LLType > &&  other)
defaultnoexcept

Default Move constructor.

Parameters
other- the object that you want to transfer ownership from

Member Function Documentation

◆ insertAtEnd()

template<class LLType >
virtual LinkedList & LinkedList< LLType >::insertAtEnd ( const LLType &  value)
inlinevirtual

Inserts a value at the end of the linked list.

Parameters
value- the value that you want to pass to the back of the linked list

◆ insertAtFront()

template<class LLType >
virtual LinkedList & LinkedList< LLType >::insertAtFront ( const LLType &  value)
inlinevirtual

Inserts a value at the front of the linked list.

Parameters
value- the value that you want to pass to the front of the linked list

◆ operator=()

template<class LLType >
virtual LinkedList< LLType > & LinkedList< LLType >::operator= ( LinkedList< LLType > &&  other)
virtualdefaultnoexcept

Move assignment operator.

Parameters
other- the object that you want to transfer ownership from

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