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