TheAlgorithms/C++
1.0.0
All the algorithms implemented in C++
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
z
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
z
Variables
Typedefs
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
~
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
p
q
r
s
t
u
v
w
x
y
Typedefs
Related Symbols
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
z
Variables
Typedefs
Macros
Examples
▼
TheAlgorithms/C++
►
The Algorithms - C++
►
Contributor Covenant Code of Conduct
►
Code style convention
►
CONTRIBUTION GUIDELINES
►
Backtracking
Prime factorization
Guidelines for reviewers and maintainers
Todo List
►
Topics
►
Namespaces
►
Classes
▼
Files
▼
File List
►
backtracking
►
bit_manipulation
►
ciphers
►
cpu_scheduling_algorithms
▼
data_structures
▼
cll
cll.cpp
cll.h
main_cll.cpp
►
avltree.cpp
►
binary_search_tree.cpp
►
binary_search_tree2.cpp
►
binaryheap.cpp
►
bloom_filter.cpp
circular_queue_using_linked_list.cpp
►
disjoint_set.cpp
doubly_linked_list.cpp
►
dsu_path_compression.cpp
►
dsu_union_rank.cpp
►
linked_list.cpp
►
linkedlist_implentation_usingarray.cpp
►
list_array.cpp
morrisinorder.cpp
►
node.hpp
queue.hpp
►
queue_using_array.cpp
queue_using_array2.cpp
queue_using_linked_list.cpp
queue_using_linkedlist.cpp
►
queue_using_two_stacks.cpp
rb_tree.cpp
►
reverse_a_linked_list.cpp
►
segment_tree.cpp
►
skip_list.cpp
►
sparse_table.cpp
►
stack.hpp
stack_using_array.cpp
stack_using_linked_list.cpp
stack_using_queue.cpp
test_queue.cpp
test_stack.cpp
test_stack_students.cpp
►
treap.cpp
tree.cpp
►
tree_234.cpp
►
trie_modern.cpp
►
trie_tree.cpp
►
trie_using_hashmap.cpp
►
divide_and_conquer
►
dynamic_programming
►
games
►
geometry
►
graph
►
graphics
►
greedy_algorithms
►
hashing
►
machine_learning
►
math
►
numerical_methods
►
operations_on_datastructures
►
others
►
physics
►
probability
►
range_queries
►
scripts
►
search
►
sorting
►
strings
►
File Members
►
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
cll.h
1
/*
2
* Simple data structure CLL (Cicular Linear Linked List)
3
* */
4
#include <cctype>
5
#include <cstdlib>
6
#include <cstring>
7
#include <iostream>
8
9
#ifndef CLL_H
10
#define CLL_H
11
/*The data structure is a linear linked list of integers */
12
struct
node
{
13
int
data;
14
node
* next;
15
};
16
17
class
cll
{
18
public
:
19
cll
();
/* Construct without parameter */
20
~cll
();
21
void
display();
/* Show the list */
22
23
/******************************************************
24
* Useful method for list
25
*******************************************************/
26
void
insert_front(
int
new_data);
/* Insert a new value at head */
27
void
insert_tail(
int
new_data);
/* Insert a new value at tail */
28
int
get_size();
/* Get total element in list */
29
bool
find_item(
int
item_to_find);
/* Find an item in list */
30
31
/******************************************************
32
* Overloading method for list
33
*******************************************************/
34
int
operator*();
/* Returns the info contained in head */
35
/* Overload the pre-increment operator.
36
The iterator is advanced to the next node. */
37
void
operator++();
38
39
protected
:
40
node
* head;
41
int
total;
/* Total element in a list */
42
};
17
class
cll
{
…
};
43
#endif
cll
Definition
cll.h:17
node
Definition
binary_search_tree.cpp:11
data_structures
cll
cll.h
Generated by
1.12.0