A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://TheAlgorithms.github.io/C-Plus-Plus/d7/d85/doubly__linked__list_8cpp_source.html below:

TheAlgorithms/C++: data_structures/doubly_linked_list.cpp Source File

11class

double_linked_list {

13

double_linked_list() { start = NULL; }

21void

double_linked_list::insert(

int

x) {

24 while

(t->next != NULL) {

41void

double_linked_list::remove(

int

x) {

43 while

(t != NULL && t->val != x) {

49 if

(t->prev == NULL) {

50 if

(t->next == NULL) {

56

}

else if

(t->next == NULL) {

59

t->prev->next = t->next;

60

t->next->prev = t->prev;

65void

double_linked_list::search(

int

x) {

70

std::cout <<

"\nFound"

;

77

std::cout <<

"\nNot Found"

;

81void

double_linked_list::show() {

84

std::cout << t->val <<

"\t"

;

89void

double_linked_list::reverseShow() {

91 while

(t != NULL && t->next != NULL) {

95

std::cout << t->val <<

"\t"

;

104

std::cout <<

"\n1. Insert"

;

105

std::cout <<

"\n2. Delete"

;

106

std::cout <<

"\n3. Search"

;

107

std::cout <<

"\n4. Forward print"

;

108

std::cout <<

"\n5. Reverse print"

;

109

std::cout <<

"\n\nEnter you choice : "

;

113

std::cout <<

"\nEnter the element to be inserted : "

;

118

std::cout <<

"\nEnter the element to be removed : "

;

123

std::cout <<

"\nEnter the element to be searched : "

;

134

}

while

(choice != 0);

struct node { int data; int height; struct node *left; struct node *right;} node

for std::queue

int main()

Main function.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4