void medis::del() { node1* t = new node1; string pav; cout << "Iveskite prekes pav kuria norite istrinti" << endl; cin >> pav; t = get(pav); node1 *m = first; while (m) { if (m->right == NULL && m->left == NULL) { //cout << "rastas lapas" << endl; t = m; first = t; delete m; break; } else { if (m->right != NULL) m = m->right; else m = m->left; } } }