GithubHelp home page GithubHelp logo

basemax / circularlinkedlistcpp Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 23 KB

This is a simple implementation of a circular linked-list in C++.

License: GNU General Public License v3.0

C++ 100.00%
circular circular-linked-list cpp data-structure datastructure ds linked-list linkedlist

circularlinkedlistcpp's Introduction

Circular Linked-List C++

This is a simple implementation of a circular linked-list in C++.

Features

  • Add a new node at beginning of list.
  • Add a new node at end of list.
  • Add a new node after a data.
  • Add a new node before a data.
  • Add a new node after a index.
  • Add a new node before a index.
  • Get the index of a data.
  • Get the data of a index.
  • Check if list is empty.
  • Check if list contains a data.
  • Check if list contains a index.
  • Get the size of list.
  • Print the list.
  • Print the list in reverse order.
  • Reverse the linkedlist (iterative function)
  • Recursive function to reverse the linkedlist.
  • Delete a node at beginning of list.
  • Delete a node at end of list.
  • Delete a node after a data.
  • Delete a node before a data.
  • Delete a node after a index.
  • Delete a node before a index.
  • Delete a node by data.
  • Delete a node by index.
  • Delete all nodes by data.
  • Delete all nodes by index.
  • Delete all nodes.
  • Delete the list.
  • Clear the list.
  • Copy the list.

Functions

  • Node::Node(int data): Constructor for the node class.

  • CircularLinkedList::CircularLinkedList(): Constructor for the CircularLinkedList class.

  • void CircularLinkedList::addFirst(int data): Add a new node at beginning of list.

  • void CircularLinkedList::addLast(int data): Add a new node at end of list.

  • void CircularLinkedList::addAfter(int data, int newData): Add a new node after a data.

  • void CircularLinkedList::addBefore(int data, int newData): Add a new node before a data.

  • void CircularLinkedList::addAfterIndex(int index, int newData): Add a new node after a index.

  • void CircularLinkedList::addBeforeIndex(int index, int newData): Add a new node before a index.

  • int CircularLinkedList::indexOf(int data): Get the index of a data.

  • int CircularLinkedList::get(int index): Get the data of a index.

  • bool CircularLinkedList::isEmpty(): Check if list is empty.

  • bool CircularLinkedList::contains(int data): Check if list contains a data.

  • bool CircularLinkedList::containsIndex(int index): Check if list contains a index.

  • int CircularLinkedList::getSize(): Get the size of list.

  • void CircularLinkedList::print(): Print the list.

  • void CircularLinkedList::printReverse(): Print the list in reverse order.

  • void CircularLinkedList::reverse(): Reverse the linkedlist (iterative function)

  • void CircularLinkedList::reverseRecursive(Node* current, Node* prev): Recursive function to reverse the linkedlist.

  • CircularLinkedList* CircularLinkedList::copy(): Copy the list.

  • void removeFirst(): Delete a node at beginning of list.

  • void removeLast(): Delete a node at end of list.

  • void remove(int data): Delete a node by data.

  • void removeIndex(int index): Delete a node by index.

  • void CircularLinkedList::clear(): Clear the list.

© Copyright Max Base, 2022

circularlinkedlistcpp's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.