Algorithms_in_C++ 1.0.0
Set of 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:

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

Function Documentation

◆ main()

int main ( void )

main function

Returns
0 on exit
345 {
346 test(); // run self-test implementations
347 return 0;
348}
static void test()
Function to test the correctness of the Circular Linked List.
Definition circular_linked_list.cpp:333
Here is the call graph for this function:

◆ test()

static void test ( )
static

Function to test the correctness of the Circular Linked List.

Returns
void
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.
Definition array_left_rotation.cpp:75
void test4()
A Test to check a very large input.
Definition array_left_rotation.cpp:120
void test3()
A Test to check an invalid shift value.
Definition array_left_rotation.cpp:105
void test2()
A Test to check an empty vector.
Definition array_left_rotation.cpp:90
void test5()
A Test to check a shift of zero.
Definition array_left_rotation.cpp:143
Here is the call graph for this function: