TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
Loading...
Searching...
No Matches
circular_linked_list.cpp File Reference

Implementation for a Circular Linked List. More...

#include <cassert>
#include <iostream>
#include <vector>
Include dependency graph for circular_linked_list.cpp:

Go to the source code of this file.

Classes

struct  operations_on_datastructures::circular_linked_list::Node
 A Node struct that represents a single Node in a Binary Tree. More...
 
class  operations_on_datastructures::circular_linked_list::CircularLinkedList
 A class that implements a Circular Linked List. More...
 

Namespaces

namespace  operations_on_datastructures
 for std::vector
 
namespace  circular_linked_list
 Functions for the Circular Linked List implementation.
 
namespace  tests
 Testcases to check Union of Two Arrays.
 

Functions

void tests::test1 ()
 A Test to check an simple case.
 
void tests::test2 ()
 A Test to check an empty vector.
 
void tests::test3 ()
 A Test to check an invalid shift value.
 
void tests::test4 ()
 A Test to check a very large input.
 
void tests::test5 ()
 A Test to check a shift of zero.
 
static void test ()
 Function to test the correctness of the Circular Linked List.
 
int main ()
 main function
 

Detailed Description

Implementation for a Circular Linked List.

A Circular Linked List is a variation on the regular linked list, in which the last node has a pointer to the first node, which creates a full circle. Consequently, this allows any node to be used as the starting point for the list.

Author
Alvin

Definition in file circular_linked_list.cpp.

Function Documentation

◆ main()

int main ( void )

main function

Returns
0 on exit

Definition at line 345 of file circular_linked_list.cpp.

345 {
346 test(); // run self-test implementations
347 return 0;
348}
static void test()
Function to test the correctness of the Circular Linked List.

◆ test()

static void test ( )
static

Function to test the correctness of the Circular Linked List.

Returns
void

Definition at line 333 of file circular_linked_list.cpp.

333 {
334 tests::test1();
335 tests::test2();
336 tests::test3();
337 tests::test4();
338 tests::test5();
339}
void test1()
A Test to check an simple case.
void test4()
A Test to check a very large input.
void test3()
A Test to check an invalid shift value.
void test2()
A Test to check an empty vector.
void test5()
A Test to check a shift of zero.