double_linked_list {
13double_linked_list() { start = NULL; }
21voiddouble_linked_list::insert(
intx) {
24 while(t->next != NULL) {
41voiddouble_linked_list::remove(
intx) {
43 while(t != NULL && t->val != x) {
49 if(t->prev == NULL) {
50 if(t->next == NULL) {
56}
else if(t->next == NULL) {
59t->prev->next = t->next;
60t->next->prev = t->prev;
65voiddouble_linked_list::search(
intx) {
70std::cout <<
"\nFound";
77std::cout <<
"\nNot Found";
81voiddouble_linked_list::show() {
84std::cout << t->val <<
"\t";
89voiddouble_linked_list::reverseShow() {
91 while(t != NULL && t->next != NULL) {
95std::cout << t->val <<
"\t";
104std::cout <<
"\n1. Insert";
105std::cout <<
"\n2. Delete";
106std::cout <<
"\n3. Search";
107std::cout <<
"\n4. Forward print";
108std::cout <<
"\n5. Reverse print";
109std::cout <<
"\n\nEnter you choice : ";
113std::cout <<
"\nEnter the element to be inserted : ";
118std::cout <<
"\nEnter the element to be removed : ";
123std::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