daily pastebin goal
35%
SHARE
TWEET

Untitled

a guest Feb 21st, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void sorted_type::remove(std::string uid) {
  2.     node_type *ph = NULL;
  3.     node_type *node_ptr = data;
  4.     if (node_ptr->info.get_uid() == uid) {
  5.         ph = node_ptr;
  6.         data = node_ptr->next;
  7.     }
  8.     while (node_ptr->next) {
  9.         if (node_ptr->next->info.get_uid() == uid) {
  10.             ph = node_ptr->next;
  11.             node_ptr->next = node_ptr->next->next ? node_ptr->next->next : NULL;
  12.             break;
  13.         }
  14.         node_ptr = node_ptr->next;
  15.     }
  16.     delete ph;
  17.     size--;
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top