Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void sorted_type::remove(std::string uid) {
- node_type *ph = NULL;
- node_type *node_ptr = data;
- if (node_ptr->info.get_uid() == uid) {
- ph = node_ptr;
- data = node_ptr->next;
- }
- while (node_ptr->next) {
- if (node_ptr->next->info.get_uid() == uid) {
- ph = node_ptr->next;
- node_ptr->next = node_ptr->next->next ? node_ptr->next->next : NULL;
- break;
- }
- node_ptr = node_ptr->next;
- }
- delete ph;
- size--;
- }
Add Comment
Please, Sign In to add comment