#include<iostream> using namespace std; void Deletion(Mynode** p_node, int p_Val) { if(*p_node == NULL) return ; Mynode* tmp = *p_node, prev = *p_node; while(tmp != NULL) { if(tmp->val == p_Val) { //some miss logic will be there, i need less iteration. prev->m_Next = tmp->m_Next; delete tmp; return ; } prev = tmp; tmp = tmp->m_Next; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)