All Projects → primeare → LinkedList

primeare / LinkedList

Licence: MIT license
An implementation of the Doubly Linked List in C++

Programming Languages

C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to LinkedList

Dsa Geeksclasses
DSA-Self Paced With Doubt Assistance Course Solutions in Python (Python 3)
Stars: ✭ 137 (+756.25%)
Mutual labels:  linked-list
Dashboard
A collection of open source projects relevant for industrial ecology practitioners, hosted on GitHub and beyond
Stars: ✭ 107 (+568.75%)
Mutual labels:  linked-list
DSA--GeeksForGeeks
DSA course solutions in C++ Jump to below directly for more problems
Stars: ✭ 47 (+193.75%)
Mutual labels:  linked-list
Sc
Common libraries and data structures for C.
Stars: ✭ 161 (+906.25%)
Mutual labels:  linked-list
Problem-Solving
This Repository consists of my solutions💡 in Python 3 to various problems in Data Structures and Algorithms.🎖️
Stars: ✭ 17 (+6.25%)
Mutual labels:  linked-list
Data-Structure-Algorithm-Programs
This Repo consists of Data structures and Algorithms
Stars: ✭ 464 (+2800%)
Mutual labels:  linked-list
Data Structures
Data-Structures using C++.
Stars: ✭ 121 (+656.25%)
Mutual labels:  linked-list
js-symbol-tree
Turn any collection of objects into its own efficient tree or linked list using Symbol
Stars: ✭ 86 (+437.5%)
Mutual labels:  linked-list
Golang Examples
Some examples for the programming language Go.
Stars: ✭ 14 (-12.5%)
Mutual labels:  linked-list
InterviewPrep
A repository containing link of good interview questions
Stars: ✭ 54 (+237.5%)
Mutual labels:  linked-list
Interviewbit
Collection of Abhishek Agrawal's gists solutions for problems on https://www.interviewbit.com
Stars: ✭ 166 (+937.5%)
Mutual labels:  linked-list
Interview Questions
List of all the Interview questions practiced from online resources and books
Stars: ✭ 187 (+1068.75%)
Mutual labels:  linked-list
dsa
data structure and algorithm - examples and implementations
Stars: ✭ 13 (-18.75%)
Mutual labels:  linked-list
Data Structures
Common data structures and algorithms implemented in JavaScript
Stars: ✭ 139 (+768.75%)
Mutual labels:  linked-list
concurrent-ll
concurrent linked list implementation
Stars: ✭ 66 (+312.5%)
Mutual labels:  linked-list
Data Structures With Go
Data Structures with Go Language
Stars: ✭ 121 (+656.25%)
Mutual labels:  linked-list
Heisenberg
Chemical Structure Builder with Swift & iOS ⚛️🧪
Stars: ✭ 51 (+218.75%)
Mutual labels:  linked-list
needle
📌📚 An extensive standalone data structure library for JavaScript.
Stars: ✭ 25 (+56.25%)
Mutual labels:  linked-list
LeetCode
Solution to LeetCode Problems in Python and Golang 🎯
Stars: ✭ 12 (-25%)
Mutual labels:  linked-list
interview-cookbook
A playground for learning DataStructures, Algorithms, and Object-Oriented Concepts.
Stars: ✭ 25 (+56.25%)
Mutual labels:  linked-list

Doubly Linked List

This is an implementation of the doubly linked list in C++ with extended functionality. This list allows you to create lists of any data, even your own data structures. A doubly linked list does not permit null elements, but can be empty. A doubly linked list is widely used in different algorithms and for storing data.

Features and Examples

  • Create an empty List
// Example: Create an empty List of integers with the name "list"
LinkedList<int> list;
  • Create a List with prefilled values
// you can prefill List with any amount of values
// Example: Create a List of strings called "list" with prefilled values ("Hello", "World")
LinkedList<string> list({ "Hello", "World" });
  • Get the current size of the List
size_t size();
  • Get the current List state: empty or not empty
bool isEmpty();
  • Clear the List - remove all elements from the List
void clear();
  • Check whether the List contains specific value. Returns true if the value is present in the List, otherwise - false
bool contains(value);
  • Add a new value to the List
void add(value);
  • Add a new value to the specific place in the List by an index starting from 0. After insertion element will be available on that index. If the List is empty, then the value will be added to the List
void add(index, value);
  • Add new values to the List
void addAll(values);
// Example
list.addAll({ 'a', 'b', 'c', 'a', 'b', 's' });
  • Remove all elements with a specific value from the List. Returns true if successful or false if the value is not present in the List
bool remove(value);
  • Remove a specific element from the List by its index starting from 0. Returns the value of the removed element
Type remove(index);
  • Remove all values from the List. Returns true if all enumerated values were removed successfully; otherwise, it returns false and keeps the List untouched.
bool removeAll(values);
// Example
list.removeAll({ 3.14, 5.34, 7.1231 });
  • Get the value of the element from the List by its index starting from 0
Type get(index);
  • Set a new value to the element from the List by its index starting from 0. Returns the previous value of the element
Type set(index, value);
  • Find the first appearance of the value in the List. Returns index of the found element
size_t indexOf(value);
  • Find the last appearance of the value in the List. Returns index of the found element
size_t lastIndexOf(value);
  • Swap elements represented by their indexes. Returns true if indexes are correct; otherwise, it returns false
bool swap(index1, index2);
  • Sort the List in ascending order
void sort();
  • Get a specific List element by its index starting from 0. Returns element from the List
// Examples
#include <iostream>
std::cout << list[0];
// or
list[3] = 15;
// or
list[1] = list[5];
  • Output the List to the standard output stream
// Example
#include <iostream>
std::cout << list << std::endl;
// Will output the List in the following format: [element0, element1, ..., elementN]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].