Advertisement
Guest User

Siup

a guest
Oct 14th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. void FindKey(int value)
  2.     {
  3.         node* temp;
  4.         temp = head;
  5.         if (temp == NULL)
  6.         {
  7.             cout << endl << "List is empty" << endl;
  8.             return;
  9.         }
  10.         else
  11.         {
  12.             while (temp != NULL && temp->key != value)
  13.             {
  14.                 temp = temp->next;
  15.             }
  16.             if (temp == NULL)
  17.             {
  18.                 cout << endl << "Element does not exist" << endl;
  19.             }
  20.             else
  21.             {
  22.                 cout << endl << "Element does exist";
  23.                 cout<< endl << "key:" << temp->key;
  24.                 cout << endl << "d_variable:" << temp->d_variable;
  25.                 cout << endl << "ch_variable:" << temp->ch_variable;
  26.             }
  27.         }
  28.  
  29.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement